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. In the context of the bias-variance tradeoff, which of the following is a characteristic of a high-bias model?
easy
Solution
Step 1: Identify characteristics of high-bias models
High-bias models are typically simple and underfit the training data.Step 2: Eliminate wrong options
It has high flexibility and can fit the training data well. describes high-variance models. It has high variance and is sensitive to noise in the training data. is incorrect as it describes high-variance models. It performs well on both training and unseen data. is incorrect because high-bias models do not perform well on training data.Final Answer:
Option A -> Option AQuick Check:
High-bias models underfit. [OK]
Hint: High-bias models underfit. [OK]
Common Mistakes:
3.
import numpy as np
from sklearn.neighbors import NearestNeighbors
X = np.array([[1, 2], [3, 4], [5, 6]])
knn = NearestNeighbors(n_neighbors=2)
knn.fit(X)
distances, indices = knn.kneighbors([[1, 2]])
print(indices)What does this code output?easy
Solution
Step 1: Understand kneighbors output
The code finds the 2 nearest neighbors of [1, 2] in X.Step 2: Calculate distances
[1, 2] is closest to itself (index 0) and then to [3, 4] (index 1).Final Answer:
Option C -> Option CQuick Check:
Self is always nearest. [OK]
Hint: Self is always nearest. [OK]
Common Mistakes:
4. In a scenario where computational resources are limited, which approach is more suitable for sequence-to-sequence tasks and why?
medium
Solution
Step 1: Evaluate computational efficiency.
Attention mechanisms allow for parallel processing, making them more efficient with limited resources.Step 2: Eliminate wrong options.
Use RNNs because they require less memory than attention mechanisms. is incorrect as attention mechanisms can be more memory efficient due to parallelism. Use RNNs because they are faster to train than attention mechanisms. is incorrect because RNNs are slower due to sequential processing. Use attention mechanisms because they are more interpretable than RNNs. is incorrect as interpretability is not the main concern here.Final Answer:
Option C -> Option CQuick Check:
Parallel processing saves resources. [OK]
Hint: Parallel processing saves resources. [OK]
Common Mistakes:
5. 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:
