Practice
1. You implemented Robust Scaling but your model's performance dropped. What is the most likely cause?
medium
Solution
Step 1: Understand Robust Scaling
Robust Scaling uses the median and IQR, which reduces the influence of outliers.Step 2: Identify the Issue
If outliers are important, reducing their influence can harm model performance.Final Answer:
Option D -> Option DQuick Check:
Robust Scaling reduces outlier impact. [OK]
Hint: Robust Scaling reduces outlier impact. [OK]
Common Mistakes:
2. In a dataset with both categorical and numerical features, which scaling method is most appropriate?
medium
Solution
Step 1: Identify Feature Types
Numerical features benefit from scaling, while categorical features require encoding.Step 2: Choose Appropriate Methods
Min-Max scaling is suitable for numerical features, and one-hot encoding is standard for categorical features.Final Answer:
Option B -> Option BQuick Check:
Scale numerical, encode categorical. [OK]
Hint: Scale numerical, encode categorical. [OK]
Common Mistakes:
3. In your implementation of K-Means, the algorithm is not converging. What is the most likely cause?
medium
Solution
Step 1: Identify convergence issues
Poorly chosen initial centroids can lead to non-convergence as they may not represent the data well.Step 2: Eliminate wrong options
The number of clusters is too large. is incorrect because a large number of clusters doesn't prevent convergence. The dataset is too small. is incorrect as a small dataset doesn't inherently cause non-convergence. The distance metric is incorrect. is incorrect if the metric is consistent.Final Answer:
Option C -> Option CQuick Check:
Check initial centroids for convergence issues. [OK]
Hint: Check initial centroids for convergence issues. [OK]
Common Mistakes:
4. How would you modify the Mini-Batch SGD with Momentum to handle sparse data more efficiently?
medium
Solution
Step 1: Identify the challenge with sparse data
Sparse data often leads to many zero gradients, making full updates inefficient.Step 2: Choose the appropriate modification
Lazy updates only update non-zero elements, reducing unnecessary computations and improving efficiency.Final Answer:
Option D -> Option DQuick Check:
Use lazy updates for sparse data efficiency [OK]
Hint: Use lazy updates for sparse data efficiency [OK]
Common Mistakes:
5. How can you optimize the NDCG calculation for large datasets?
hard
Solution
Step 1: Identify Bottlenecks
Calculating log values repeatedly can be computationally expensive.Step 2: Optimize Calculation
Precomputing log values for positions reduces redundant calculations.Final Answer:
Option C -> Option CQuick Check:
Precompute logs for efficiency. [OK]
Hint: Precompute logs for efficiency. [OK]
Common Mistakes:
