Practice
1. In the context of model calibration, which metric is most appropriate to evaluate the probability outputs of a classifier?
easy
Solution
Step 1: Identify the purpose of calibration.
Calibration aims to ensure that predicted probabilities reflect true likelihoods.Step 2: Evaluate each metric.
Accuracy, precision, and F1 score do not consider probability estimates, only classification decisions. Log Loss penalizes incorrect probability estimates, making it suitable for calibration.Final Answer:
Option C -> Option CQuick Check:
Log Loss evaluates probability accuracy. [OK]
Hint: Log Loss evaluates probability accuracy. [OK]
Common Mistakes:
2. What will be the output shape of the following code snippet using K-Fold cross-validation with 5 splits on a dataset of 100 samples?
from sklearn.model_selection import KFold
kf = KFold(n_splits=5)
for train_index, test_index in kf.split(range(100)):
print(len(test_index))easy
Solution
Step 1: Calculate the number of samples per fold.
100 samples divided by 5 splits results in 20 samples per fold.Step 2: Eliminate wrong options.
25 samples per fold (B) is incorrect, 6 outputs (C) is incorrect, 4 outputs (D) is incorrect.Final Answer:
Option A -> Option AQuick Check:
100 samples, 5 splits = 20 per fold. [OK]
Hint: 100 samples, 5 splits = 20 per fold. [OK]
Common Mistakes:
3. You notice that your YOLO model is missing small objects in images. What is the most likely cause?
medium
Solution
Step 1: Identify the problem
Missing small objects often relates to anchor box size.Step 2: Analyze options
The model's anchor boxes are too large is correct because large anchor boxes can miss small objects. The learning rate is too high affects convergence, not detection size. The batch size is too small affects training stability, not object size. The model's confidence threshold is too low would increase false positives, not miss objects.Final Answer:
Option D -> Option DQuick Check:
Small objects need small anchors [OK]
Hint: Small objects need small anchors [OK]
Common Mistakes:
4. A retail company wants to use ML to optimize inventory levels. Which approach best frames this business problem as an ML problem?
hard
Solution
Step 1: Identify the core ML task
Predicting future sales based on historical data aligns well with regression, which is suitable for continuous output prediction.Step 2: Eliminate wrong options
Use clustering to group similar products and predict demand is incorrect because clustering is unsupervised and doesn't predict demand. Use classification to categorize products into high and low demand is incorrect because classification is for discrete categories, not continuous predictions. Use reinforcement learning to dynamically adjust inventory levels is incorrect because reinforcement learning is complex and not necessary for static predictions.Final Answer:
Option A -> Option AQuick Check:
Use regression for continuous predictions like sales. [OK]
Hint: Use regression for continuous predictions like sales. [OK]
Common Mistakes:
5. You need to implement a real-time recommendation system. Which approach is most suitable given the need for low latency and high throughput?
hard
Solution
Step 1: Identify the requirements.
Real-time systems require low latency and high throughput.Step 2: Choose the approach that meets these requirements.
Online learning with a streaming framework allows for real-time updates and low latency.Final Answer:
Option A -> Option AQuick Check:
Streaming fits real-time needs. [OK]
Hint: Streaming fits real-time needs. [OK]
Common Mistakes:
