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. A model's performance improved significantly on the test set but not on the validation set. What is the most likely cause?
medium
Solution
Step 1: Analyze performance discrepancy
Significant improvement on the test set but not on the validation set suggests an issue with test set integrity.Step 2: Identify data leakage
Data leakage from the test set can artificially inflate performance metrics.Final Answer:
Option A -> Option AQuick Check:
Test set improvement only? Check for leakage [OK]
Hint: Test set improvement only? Check for leakage [OK]
Common Mistakes:
3. How would you adapt K-Fold cross-validation for a dataset with a temporal component and class imbalance?
hard
Solution
Step 1: Address both temporal order and class imbalance.
Time Series Split respects temporal order, and manual balancing addresses class imbalance.Step 2: Eliminate wrong options.
Standard K-Fold (A) ignores temporal order, Stratified K-Fold (B) doesn't respect temporal order, Leave-One-Out (D) is computationally expensive and doesn't address temporal order.Final Answer:
Option D -> Option DQuick Check:
Time series + imbalance = manual balance. [OK]
Hint: Time series + imbalance = manual balance. [OK]
Common Mistakes:
4. In a real-time prediction system, how should you handle data splits to ensure both model performance and system efficiency?
hard
Solution
Step 1: Consider real-time constraints
Real-time systems need to adapt to new data while maintaining performance.Step 2: Evaluate options for adaptability and efficiency
Use a single train-test split to minimize latency. risks overfitting. Use a large test set to ensure model robustness. misallocates resources. Use a static validation set to simplify the system. lacks adaptability to new data.Final Answer:
Option D -> Option DQuick Check:
Rolling window adapts to new data efficiently. [OK]
Hint: Rolling window adapts to new data efficiently. [OK]
Common Mistakes:
5. You need to implement a sequence-to-sequence model for a translation task. How would you modify a standard LSTM to better handle varying sequence lengths?
hard
Solution
Step 1: Identify the challenge with varying sequence lengths.
Attention mechanisms help focus on relevant parts of the input, improving handling of varying lengths.Step 2: Eliminate wrong options.
Bidirectional LSTMs capture context but don't address varying lengths. More layers increase capacity but not sequence handling. GRU is faster but doesn't solve length variability.Final Answer:
Option D -> Option DQuick Check:
Attention helps with varying lengths. [OK]
Hint: Attention helps with varying lengths. [OK]
Common Mistakes:
