Practice
1. In which scenario is normalization preferred over standardization?
easy
Solution
Step 1: Understand the purpose of normalization.
Normalization scales the data to a range of [0, 1] and is useful when data is on different scales.Step 2: Eliminate wrong options.
When the data follows a Gaussian distribution. is incorrect because standardization is preferred for Gaussian distributions. When the data contains outliers. is incorrect because normalization is sensitive to outliers. When the model is sensitive to variance. is incorrect because standardization handles variance better.Final Answer:
Option A -> Option AQuick Check:
Normalize for non-Gaussian, different scales. [OK]
Hint: Normalize for non-Gaussian, different scales. [OK]
Common Mistakes:
2. In the context of monitoring ML models in production, which of the following best describes data drift?
easy
Solution
Step 1: Define data drift
Data drift refers to changes in the statistical properties of input data over time.Step 2: Eliminate wrong options
A sudden drop in model accuracy due to a bug in the code. describes a bug, not data drift. An increase in the model's training time due to larger datasets. is about computational resources, not data properties. A decrease in the model's interpretability over time. is unrelated to data drift.Final Answer:
Option C -> Option CQuick Check:
Data drift = change in data stats [OK]
Hint: Data drift = change in data stats [OK]
Common Mistakes:
3. Given the following Python code snippet, what will be the output when calculating the Euclidean distance between two high-dimensional points?
import numpy as np
point1 = np.array([1, 2, 3, ..., 1000])
point2 = np.array([2, 3, 4, ..., 1001])
distance = np.linalg.norm(point1 - point2)
print(distance)easy
Solution
Step 1: Calculate the difference between points.
The difference is [1, 1, 1, ..., 1].Step 2: Calculate the Euclidean distance.
The distance is sqrt(1000) = 31.62.Final Answer:
Option D -> Option DQuick Check:
Euclidean distance in high dimensions is sqrt(n). [OK]
Hint: Euclidean distance in high dimensions is sqrt(n). [OK]
Common Mistakes:
4. You are tasked with designing a fraud detection system. How would you ensure that your model does not suffer from data leakage?
hard
Solution
Step 1: Identify potential leakage sources in fraud detection
Using future-derived features can cause leakage.Step 2: Evaluate each option
Use cross-validation with shuffling to ensure robust performance. might introduce leakage if shuffling is inappropriate, Include all available transaction data up to the current date in the training set. risks future data leakage, Use a single train-test split to simplify the evaluation process. is simplistic and risky.Final Answer:
Option A -> Option AQuick Check:
Avoid future-derived features in training [OK]
Hint: Avoid future-derived features in training [OK]
Common Mistakes:
5. You are tasked with developing a system that can autonomously drive a car in a simulated environment. Which learning approach should you prioritize and why?
hard
Solution
Step 1: Identify the task requirements.
The task requires learning optimal strategies in a dynamic environment.Step 2: Eliminate wrong options.
Supervised learning, because it can learn from labeled driving data. is incorrect because labeled data alone doesn't adapt to new scenarios. Unsupervised learning, because it can discover patterns in driving data. is incorrect because pattern discovery doesn't imply strategy learning. Supervised learning, because it can classify different driving scenarios. is incorrect because classification doesn't optimize actions.Final Answer:
Option C -> Option CQuick Check:
Dynamic strategy learning -> Reinforcement learning [OK]
Hint: Dynamic strategy learning -> Reinforcement learning [OK]
Common Mistakes:
