0
0
Computer Visionml~20 mins

Model evaluation best practices in Computer Vision - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Model Evaluation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Overfitting in Model Evaluation

Which of the following best describes the problem of overfitting during model evaluation?

AThe model performs poorly on both training and test data.
BThe model performs well on test data but poorly on training data.
CThe model performs well on training data but poorly on new, unseen data.
DThe model performs equally well on training and test data.
Attempts:
2 left
💡 Hint

Think about when a model memorizes training data but fails to generalize.

Metrics
intermediate
2:00remaining
Choosing the Right Metric for Imbalanced Data

You have a binary classification model for detecting rare diseases in images. Which metric is most appropriate to evaluate the model?

AAccuracy
BF1 Score
CPrecision
DRecall
Attempts:
2 left
💡 Hint

Consider a metric that balances false positives and false negatives.

Predict Output
advanced
2:00remaining
Output of Cross-Validation Accuracy Calculation

What is the output of the following Python code snippet?

Computer Vision
from sklearn.datasets import load_digits
from sklearn.model_selection import cross_val_score
from sklearn.svm import SVC

data = load_digits()
X, y = data.data, data.target
model = SVC(kernel='linear', random_state=42)
scores = cross_val_score(model, X, y, cv=5)
print(round(scores.mean(), 2))
A0.95
B0.85
C0.75
D0.65
Attempts:
2 left
💡 Hint

The digits dataset is relatively easy to classify with a linear SVM.

🔧 Debug
advanced
2:00remaining
Identifying the Bug in Model Evaluation Code

What error will this code raise when evaluating a classification model?

Computer Vision
from sklearn.metrics import accuracy_score

y_true = [0, 1, 2, 2, 1]
y_pred = [0, 2, 1, 2, 0]

score = accuracy_score(y_true, y_pred, average='macro')
print(score)
ATypeError: accuracy_score() got an unexpected keyword argument 'average'
BValueError: Found input variables with inconsistent numbers of samples
C0.4
DNameError: name 'average' is not defined
Attempts:
2 left
💡 Hint

Check the parameters accepted by accuracy_score.

Model Choice
expert
3:00remaining
Best Model Choice for Multi-Class Image Classification with Limited Data

You want to build a model to classify images into 10 categories. You have only 500 labeled images. Which approach is best for evaluation and model choice?

ATrain a deep CNN from scratch and evaluate on a single 80/20 train-test split.
BUse k-means clustering to label images and evaluate with silhouette score.
CTrain a simple logistic regression on raw pixels and evaluate using accuracy on training data.
DUse transfer learning with a pre-trained CNN and evaluate using stratified 5-fold cross-validation.
Attempts:
2 left
💡 Hint

Consider data size and evaluation robustness.