Practice
1. In the context of framing a business problem as an ML problem, which of the following is the most crucial first step?
easy
Solution
Step 1: Identify the core requirement
The first step in framing a business problem as an ML problem is to clearly define the business objective. Without a clear objective, the ML model cannot be aligned with business goals.Step 2: Eliminate wrong options
Selecting the right algorithm is incorrect because algorithm selection comes after defining the problem. Collecting as much data as possible is incorrect because data collection should be guided by the problem definition. Ensuring high computational resources is incorrect because computational resources are a consideration after the problem is defined.Final Answer:
Option D -> Option DQuick Check:
Start with a clear business goal. [OK]
Hint: Start with a clear business goal. [OK]
Common Mistakes:
2.
from sklearn.linear_model import Ridge
import numpy as np
X = np.array([[1, 2], [3, 4], [5, 6]])
y = np.array([1, 2, 3])
model = Ridge(alpha=0.0)
model.fit(X, y)
print(model.coef_)What does this code output?easy
Solution
Step 1: Understand the effect of alpha=0 in Ridge.
Setting alpha to zero in Ridge regression makes it equivalent to ordinary least squares.Step 2: Eliminate wrong options.
Alpha=0 does not cause an error. Zero coefficients would require L1 regularization. Random coefficients are incorrect as the model still fits the data.Final Answer:
Option B -> Option BQuick Check:
Alpha=0 in Ridge = OLS. [OK]
Hint: Alpha=0 in Ridge = OLS. [OK]
Common Mistakes:
3. A continually learning model is showing degraded performance over time. What is the most likely cause?
medium
Solution
Step 1: Identify symptoms of degraded performance.
Continual learning models can overfit to recent data, especially if not managed properly.Step 2: Eliminate other causes.
The model is not receiving enough new data. is incorrect because lack of data would not cause degradation but stagnation. The model's architecture is too simple. is incorrect because architecture simplicity would limit initial performance, not degrade it over time. The model's learning rate is too high. is incorrect because a high learning rate would cause instability, not gradual degradation.Final Answer:
Option A -> Option AQuick Check:
Degradation often means overfitting. [OK]
Hint: Degradation often means overfitting. [OK]
Common Mistakes:
4. A model performs well overall but poorly on a specific slice of data. What is the most likely cause?
medium
Solution
Step 1: Analyze the problem
Poor performance on a specific slice often indicates distribution mismatch.Step 2: Eliminate wrong options
The model is overfitting to the training data. is incorrect as overfitting would affect overall performance. The model has too many parameters. is unrelated to slice-specific issues. The learning rate is too high. affects convergence, not slice performance.Final Answer:
Option A -> Option AQuick Check:
Slice mismatch = distribution issue. [OK]
Hint: Slice mismatch = distribution issue. [OK]
Common Mistakes:
5. You are tasked with improving a model's performance on a highly imbalanced dataset. Which approach is most appropriate to prevent overfitting while addressing class imbalance?
hard
Solution
Step 1: Address class imbalance and overfitting
Class weights help balance the dataset, and early stopping prevents overfitting by halting training when validation performance stops improving.Step 2: Eliminate wrong options
Use SMOTE to oversample the minority class and increase model complexity. increases complexity, risking overfitting, Downsample the majority class and increase the learning rate. may lead to instability, and Use a simpler model with no regularization. lacks regularization, increasing overfitting risk.Final Answer:
Option C -> Option CQuick Check:
Class weights + early stopping = balanced, robust model [OK]
Hint: Class weights + early stopping = balanced, robust model [OK]
Common Mistakes:
