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 slice-based evaluation, which of the following is a key benefit?
easy
Solution
Step 1: Understand slice-based evaluation
Slice-based evaluation focuses on analyzing model performance on specific data subsets.Step 2: Eliminate wrong options
It reduces the overall training time of the model. is incorrect as slice-based evaluation doesn't affect training time. It automatically tunes hyperparameters for better performance. is incorrect because it doesn't involve hyperparameter tuning. It ensures the model is robust to adversarial attacks. is incorrect as it doesn't directly address adversarial robustness.Final Answer:
Option D -> Option DQuick Check:
Slice-based evaluation identifies weak data subsets. [OK]
Hint: Slice-based evaluation identifies weak data subsets. [OK]
Common Mistakes:
3.
import pandas as pd
from sklearn.impute import SimpleImputer
# Sample data
data = {'A': [1, 2, None, 4], 'B': [None, 2, 3, 4]}
df = pd.DataFrame(data)
# Imputation
imputer = SimpleImputer(strategy='mean')
imputed_data = imputer.fit_transform(df)
print(imputed_data)What is the output of the above code?easy
Solution
Step 1: Calculate the mean for each column
Column A mean: (1+2+4)/3 = 2.333, Column B mean: (2+3+4)/3 = 3.0Step 2: Apply mean imputation
Replace missing values with calculated means.Final Answer:
Option A -> Option AQuick Check:
Mean replaces NaN [OK]
Hint: Mean replaces NaN [OK]
Common Mistakes:
4. A model using RAG prompting is producing irrelevant information. What is the most likely cause?
medium
Solution
Step 1: Analyze RAG prompting
RAG relies on retrieving relevant documents to generate accurate responses.Step 2: Eliminate wrong options
The model is not trained on enough data. is incorrect as training data size is unrelated to retrieval. The prompt is too short. is incorrect because prompt length doesn't affect retrieval. The model's architecture is outdated. is unrelated to the issue.Final Answer:
Option A -> Option AQuick Check:
Irrelevant info? Check retrieval component in RAG. [OK]
Hint: Irrelevant info? Check retrieval component in RAG. [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:
