Practice
1. In the context of Naive Bayes, which of the following best describes the assumption of conditional independence?
easy
Solution
Step 1: Understand Conditional Independence
Naive Bayes assumes that features are independent given the class label.Step 2: Eliminate Wrong Options
Features are independent of the class label. suggests features are independent of the class label, which is incorrect. Features are dependent on each other given the class label. suggests dependency, which contradicts the assumption. Features are independent in all scenarios. suggests independence in all scenarios, which is overly broad.Final Answer:
Option B -> Option BQuick Check:
Naive Bayes assumes independence given class. [OK]
Hint: Naive Bayes assumes independence given class. [OK]
Common Mistakes:
2.
import numpy as np
from sklearn.cluster import KMeans
X = np.array([[1, 2], [1, 4], [1, 0],
[4, 2], [4, 4], [4, 0]])
kmeans = KMeans(n_clusters=2, random_state=0).fit(X)
print(kmeans.labels_)What does the code output?easy
Solution
Step 1: Understand KMeans clustering.
KMeans assigns labels based on proximity to cluster centers.Step 2: Analyze the data points.
Points [1, 2], [1, 4], [1, 0] are closer to one center, and [4, 2], [4, 4], [4, 0] to another.Final Answer:
Option A -> Option AQuick Check:
Cluster proximity determines labels [OK]
Hint: Cluster proximity determines labels [OK]
Common Mistakes:
3. A model trained with Adam optimizer is not converging. What is the most likely cause?
medium
Solution
Step 1: Identify common issues with Adam.
Adam can be sensitive to high learning rates, causing divergence.Step 2: Eliminate less likely causes.
Adam handles non-convex problems well, and batch size/weight decay are less likely to cause non-convergence.Final Answer:
Option B -> Option BQuick Check:
High lr can cause Adam to diverge. [check]
Hint: High lr can cause Adam to diverge. [check]
Common Mistakes:
4. A model trained on a dataset shows unexpected bias against a minority group. What is the most likely root cause?
medium
Solution
Step 1: Identify the symptom.
Bias against a minority group indicates potential data imbalance.Step 2: Analyze the options.
Imbalanced data (B) is a common cause of bias. Other options relate to model complexity or training dynamics, not bias directly.Final Answer:
Option A -> Option AQuick Check:
Imbalanced data often leads to bias. [OK]
Hint: Imbalanced data often leads to bias. [OK]
Common Mistakes:
5. When choosing between BPE and WordPiece for a language model, which scenario makes WordPiece a better choice?
medium
Solution
Step 1: Identify the strengths of WordPiece.
WordPiece is designed to handle rare words efficiently by breaking them into subwords.Step 2: Eliminate wrong options.
Minimizing vocabulary size (A) and handling inflection (B) are not specific strengths of WordPiece; text generation (D) is not a specific advantage.Final Answer:
Option C -> Option CQuick Check:
WordPiece excels with rare words. [OK]
Hint: WordPiece excels with rare words. [OK]
Common Mistakes:
