Practice
1. A Random Forest model is underperforming on out-of-distribution (OOD) data. What is the most likely cause?
medium
Solution
Step 1: Identify OOD challenges
OOD performance issues often arise from a lack of diversity in training data.Step 2: Analyze options
The training data lacks diversity is correct because diverse training data is crucial for generalization. The model has too many trees is incorrect as more trees generally improve robustness. The model is overfitting to the training data is incorrect because overfitting affects in-distribution performance more. The model uses too few features per split is incorrect as using fewer features can help generalization.Final Answer:
Option B -> Option BQuick Check:
OOD issues often stem from non-diverse data. [OK]
Hint: OOD issues often stem from non-diverse data. [OK]
Common Mistakes:
2. When considering bias mitigation strategies, which approach is more suitable for a scenario where you cannot alter the training data but need to ensure fairness in predictions?
medium
Solution
Step 1: Identify the constraint.
Cannot alter training data, need fairness in predictions.Step 2: Choose the suitable technique.
Post-processing techniques adjust predictions to ensure fairness without altering the model or data.Final Answer:
Option D -> Option DQuick Check:
Post-processing adjusts predictions, not data. [OK]
Hint: Post-processing adjusts predictions, not data. [OK]
Common Mistakes:
3. You implemented stratified sampling but notice that the sample still has class imbalance. What is the most likely cause?
medium
Solution
Step 1: Identify the stratified sampling requirement.
Stratified sampling requires correct class proportion specification.Step 2: Eliminate unrelated issues.
Random Sampling (B) would not be used if stratified was intended. Data leakage (C) affects model performance, not sampling. Sample size (D) affects variability, not imbalance directly.Final Answer:
Option C -> Option CQuick Check:
Check class proportions in stratified sampling [[check]]
Hint: Check class proportions in stratified sampling [[check]]
Common Mistakes:
4. How would you adapt KNN for a real-time recommendation system with millions of users and items?
hard
Solution
Step 1: Consider scalability and speed
Approximate methods like locality-sensitive hashing are suitable for large-scale, real-time systems.Step 2: Eliminate wrong options
Use exact KNN with a large number of neighbors. is incorrect due to inefficiency. Reduce the number of features to improve speed. is wrong as feature reduction alone may not suffice. Use a single global model for all users. is incorrect because personalization is key in recommendations.Final Answer:
Option A -> Option AQuick Check:
Approximate methods for real-time scale. [OK]
Hint: Approximate methods for real-time scale. [OK]
Common Mistakes:
5. You are tasked with improving a model's performance on a highly imbalanced dataset. Which approach is most appropriate to prevent overfitting while addressing class imbalance?
hard
Solution
Step 1: Address class imbalance and overfitting
Class weights help balance the dataset, and early stopping prevents overfitting by halting training when validation performance stops improving.Step 2: Eliminate wrong options
Use SMOTE to oversample the minority class and increase model complexity. increases complexity, risking overfitting, Downsample the majority class and increase the learning rate. may lead to instability, and Use a simpler model with no regularization. lacks regularization, increasing overfitting risk.Final Answer:
Option C -> Option CQuick Check:
Class weights + early stopping = balanced, robust model [OK]
Hint: Class weights + early stopping = balanced, robust model [OK]
Common Mistakes:
