Practice
1. In a dataset with highly imbalanced classes, which sampling strategy is most appropriate to ensure each class is represented proportionally in the sample?
easy
Solution
Step 1: Identify the need for proportional representation.
In imbalanced datasets, it's crucial to maintain class proportions to avoid bias.Step 2: Eliminate inappropriate strategies.
Random Sampling (A) doesn't guarantee class proportions. Reservoir Sampling (C) is for streaming data, not class balance. Weighted Sampling (D) adjusts for importance, not proportions.Final Answer:
Option A -> Option AQuick Check:
Stratified = Proportional representation [OK]
Hint: Stratified = Proportional representation [OK]
Common Mistakes:
2. A model trained with weak supervision is underperforming. What is the most likely cause?
medium
Solution
Step 1: Identify the weak supervision challenge.
Weak supervision relies on heuristics, which can be a source of error if too simplistic.Step 2: Eliminate other causes.
Model complexity and dataset size are less likely to be the primary issue in weak supervision. Learning rate affects training stability, not heuristic quality.Final Answer:
Option A -> Option AQuick Check:
Weak supervision = heuristic quality [OK]
Hint: Weak supervision = heuristic quality [OK]
Common Mistakes:
3. When should you prefer using LightGBM over XGBoost for a gradient boosting task?
medium
Solution
Step 1: Identify LightGBM's strengths
LightGBM is optimized for speed and performance on large datasets with high dimensionality.Step 2: Eliminate wrong options
When you need better accuracy on small datasets. is incorrect because XGBoost often performs better on small datasets. When interpretability of the model is the primary concern. is incorrect because neither LightGBM nor XGBoost is particularly interpretable. When you require a model that handles categorical features natively. is incorrect because both can handle categorical features, but LightGBM is faster on large datasets.Final Answer:
Option A -> Option AQuick Check:
LightGBM = Large, high-dimensional data [OK]
Hint: LightGBM = Large, high-dimensional data [OK]
Common Mistakes:
4. 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:
5. When deciding between a rule-based system and a machine learning model for a task, which scenario favors a rule-based approach?
medium
Solution
Step 1: Identify the nature of the task.
Rule-based systems excel in tasks with clear, logical rules.Step 2: Eliminate tasks requiring pattern recognition.
Options A, B, and D involve pattern recognition, which is better suited for ML.Final Answer:
Option A -> Option AQuick Check:
Rules for logic, ML for patterns. [OK]
Hint: Rules for logic, ML for patterns. [OK]
Common Mistakes:
