Practice
1. Which dimensionality reduction technique is most suitable for visualizing high-dimensional data while preserving local structures?
easy
Solution
Step 1: Understand the purpose of each technique
PCA is used for linear dimensionality reduction, UMAP is similar to t-SNE but faster, and LDA is for supervised dimensionality reduction.Step 2: Identify the technique that preserves local structures
t-SNE is specifically designed to preserve local structures in high-dimensional data.Final Answer:
Option A -> Option AQuick Check:
t-SNE for local structures [OK]
Hint: t-SNE for local structures [OK]
Common Mistakes:
2. In a regression problem where outliers are present, which metric is generally more robust to these outliers?
easy
Solution
Step 1: Understand the impact of outliers on metrics.
MAE is less sensitive to outliers compared to MSE and RMSE because it doesn't square the errors.Step 2: Eliminate wrong options.
MSE and RMSE are sensitive to outliers due to squaring errors. MAPE is not suitable for zero or near-zero values.Final Answer:
Option D -> Option DQuick Check:
MAE handles outliers better than MSE. [OK]
Hint: MAE is less sensitive to outliers than MSE. [OK]
Common Mistakes:
3. Given the following Python code snippet, what will be the output if the model is trained with biased data?
from sklearn.metrics import accuracy_score
y_true = [0, 1, 1, 0, 1]
y_pred = [0, 1, 1, 0, 0]
accuracy = accuracy_score(y_true, y_pred)
print(accuracy)easy
Solution
Step 1: Calculate the accuracy.
Accuracy is the ratio of correctly predicted instances to the total instances. Here, 3 out of 5 predictions are correct.Step 2: Compute the accuracy.
Correct predictions: [0, 1, 1] -> 0.6Final Answer:
0.6 -> 0.6Quick Check:
Count correct predictions, divide by total. [OK]
Hint: Count correct predictions, divide by total. [OK]
Common Mistakes:
4. You have a dataset with a large number of features and limited computational resources. Which feature selection method is most appropriate?
medium
Solution
Step 1: Consider computational efficiency.
Filter methods are computationally inexpensive as they do not involve training models.Step 2: Eliminate wrong options.
Wrapper methods and recursive feature elimination are computationally intensive. Embedded methods require model training, which can be resource-heavy.Final Answer:
Option D -> Option DQuick Check:
Filter = low cost, no model. [OK]
Hint: Filter methods are computationally cheap. [OK]
Common Mistakes:
5. When monitoring an ML model in production, which approach is better for detecting data drift and why?
medium
Solution
Step 1: Identify effective drift detection
Monitoring statistical properties helps detect subtle changes in input data.Step 2: Eliminate wrong options
Use a static threshold on model accuracy. is reactive, not proactive. Rely on user feedback to identify issues. is unreliable and subjective. Increase the frequency of model retraining. addresses performance decay, not drift detection.Final Answer:
Option A -> Option AQuick Check:
Monitor input stats for drift detection [OK]
Hint: Monitor input stats for drift detection [OK]
Common Mistakes:
