Practice
1. In the context of A/B testing for ML models, which method is best suited for ensuring that temporal trends do not bias the results?
easy
Solution
Step 1: Understand the methods
Interleaving method allows for simultaneous comparison, reducing temporal bias.Step 2: Eliminate wrong options
Holdout and cross-validation do not address temporal trends. Causal inference is more about understanding causality than handling temporal trends.Final Answer:
Option B -> Option BQuick Check:
Interleaving reduces temporal bias. [OK]
Hint: Interleaving reduces temporal bias. [OK]
Common Mistakes:
2.
import numpy as np
# Simulate A/B test results
A_results = np.array([1, 0, 1, 1, 0])
B_results = np.array([0, 1, 0, 0, 1])
# Calculate mean conversion rates
A_mean = np.mean(A_results)
B_mean = np.mean(B_results)
# Determine which variant is better
better_variant = 'A' if A_mean > B_mean else 'B'
print(better_variant)What does this code output?easy
Solution
Step 1: Calculate means
A_mean = 0.6, B_mean = 0.2Step 2: Compare means
A_mean > B_mean, so 'A' is printed.Final Answer:
A -> AQuick Check:
Calculate means, compare, print. [OK]
Hint: Calculate means, compare, print. [OK]
Common Mistakes:
3. In the context of data leakage, which of the following scenarios is most likely to cause leakage during model training?
easy
Solution
Step 1: Identify potential leakage sources
Data leakage occurs when information from outside the training dataset is used to create the model.Step 2: Eliminate wrong options
Using a validation set that is randomly sampled from the training data. is common practice, Normalizing features using statistics from the entire dataset before splitting. is a preprocessing mistake but not leakage, Using a large number of features in the model. is about complexity, not leakage.Final Answer:
Option A -> Option AQuick Check:
Future data in training = leakage risk [OK]
Hint: Future data in training = leakage risk [OK]
Common Mistakes:
4. A K-Means model is not converging on a dataset. What is the most likely cause?
medium
Solution
Step 1: Identify convergence issues
Centroids initialized too close can cause slow convergence or getting stuck in local minima.Step 2: Eliminate other causes
Too many clusters can cause overfitting but not convergence issues. Data normalization affects distance calculation but not convergence. Euclidean distance is standard for K-Means.Final Answer:
Option A -> Option AQuick Check:
Close centroids = slow convergence [OK]
Hint: Close centroids = slow convergence [OK]
Common Mistakes:
5. You are tasked with designing a CNN for a medical imaging application where interpretability is crucial. Which approach would best leverage the inductive bias of CNNs for this task?
hard
Solution
Step 1: Consider interpretability needs
Small kernels with more layers help capture local patterns, which are crucial for interpretability in medical imaging.Step 2: Eliminate wrong options
Use very deep networks to capture complex patterns is incorrect because very deep networks can be less interpretable. Use shallow networks with large kernels to capture global patterns is incorrect as large kernels reduce local detail capture. Use networks with attention mechanisms to highlight important regions is incorrect because attention mechanisms, while useful, are not leveraging CNN's inductive bias.Final Answer:
Option A -> Option AQuick Check:
Small kernels capture local details, aiding interpretability. [OK]
Hint: Small kernels capture local details, aiding interpretability. [OK]
Common Mistakes:
