Practice
1. In a dataset with missing values in a numerical feature, which imputation strategy is most appropriate when the data is normally distributed?
easy
Solution
Step 1: Identify the distribution of the data
For normally distributed data, the mean is the best measure of central tendency.Step 2: Eliminate wrong options
Median is better for skewed data, mode for categorical data, and zero imputation can distort the distribution.Final Answer:
Option D -> Option DQuick Check:
Mean for normal distribution [OK]
Hint: Mean for normal distribution [OK]
Common Mistakes:
2. What is the output of the following Python code snippet using NumPy for logistic regression log-odds calculation?
import numpy as np
coefficients = np.array([0.5, -0.25])
features = np.array([2, 3])
log_odds = np.dot(coefficients, features)
print(log_odds)easy
Solution
Step 1: Calculate the dot product.
The dot product is calculated as (0.5 * 2) + (-0.25 * 3) = 1.0 - 0.75 = 0.25.Step 2: Identify the correct output.
-0.25 is correct because the calculation results in 0.25. 1.25 is incorrect as it suggests a miscalculation. 0.25 is incorrect due to a sign error. 2.75 is incorrect due to a misunderstanding of dot product.Final Answer:
Option A -> Option AQuick Check:
Dot product = sum of products [OK]
Hint: Dot product = sum of products [OK]
Common Mistakes:
3. When framing a business problem as an ML problem, which trade-off is most critical to consider?
medium
Solution
Step 1: Identify the key trade-off
In many business contexts, the trade-off between accuracy and interpretability is crucial because stakeholders need to understand model decisions.Step 2: Eliminate wrong options
Data volume vs. Model complexity is incorrect because data volume and model complexity are often complementary. Training time vs. Inference time is incorrect because training and inference times are usually secondary to model performance. Feature engineering vs. Hyperparameter tuning is incorrect because feature engineering and hyperparameter tuning are not directly opposing trade-offs.Final Answer:
Option C -> Option CQuick Check:
Balance accuracy with interpretability for stakeholder trust. [OK]
Hint: Balance accuracy with interpretability for stakeholder trust. [OK]
Common Mistakes:
4. You are tasked with evaluating the effect size of a new feature in a model. Which approach is most appropriate for this task?
hard
Solution
Step 1: Identify the goal
Effect size measures the magnitude of a feature's impact, not just its statistical significance.Step 2: Choose the correct metric
Cohen's d is a standard measure for effect size, especially in comparing means.Final Answer:
Option D -> Option DQuick Check:
Effect size? Use Cohen's d [OK]
Hint: Effect size? Use Cohen's d [OK]
Common Mistakes:
5. You are tasked with designing a system to detect fraudulent transactions. Which approach is most appropriate given the need for adaptability to new fraud patterns?
hard
Solution
Step 1: Consider the need for adaptability.
Fraud patterns change over time, requiring a system that can learn and adapt.Step 2: Evaluate the options for adaptability.
Only a machine learning model that can be retrained offers the necessary adaptability.Final Answer:
Option D -> Option DQuick Check:
ML adapts, rules are static. [OK]
Hint: ML adapts, rules are static. [OK]
Common Mistakes:
