Practice
1. In the context of the No Free Lunch Theorem, which statement is true about model performance across different datasets?
easy
Solution
Step 1: Understand the No Free Lunch Theorem
The theorem states that no single model is universally best across all datasets.Step 2: Eliminate wrong options
A model that performs well on one dataset will perform well on all datasets. is incorrect because model performance varies by dataset. The best model for a dataset can be determined without testing. is incorrect because testing is necessary to determine the best model. A complex model always outperforms a simple model. is incorrect because complexity does not guarantee better performance.Final Answer:
Option B -> Option BQuick Check:
No universal best model. [OK]
Hint: No universal best model. [OK]
Common Mistakes:
2. A linear regression model trained using gradient descent is not converging. What is the most likely cause?
medium
Solution
Step 1: Identify common convergence issues
A high learning rate can cause the model to overshoot the minimum, preventing convergence.Step 2: Eliminate wrong options
A small dataset (B) or too many features (C) might affect performance but not convergence. Initial weights being zero (D) is not a convergence issue.Final Answer:
Option B -> Option BQuick Check:
High learning rate can prevent convergence. [OK]
Hint: High learning rate can prevent convergence. [OK]
Common Mistakes:
3. When evaluating a recommendation system, why might you choose NDCG over MAP?
medium
Solution
Step 1: Understand metric differences
NDCG considers the position of relevant items, giving higher weight to top-ranked items.Step 2: Eliminate wrong options
MAP considers all relevant items equally, NDCG is not necessarily easier or more interpretable, and both metrics are sensitive to the number of relevant items.Final Answer:
Option C -> Option CQuick Check:
NDCG weights top positions more. [OK]
Hint: NDCG weights top positions more. [OK]
Common Mistakes:
4. How would you adapt a decision tree to handle a dataset with a large number of categorical features?
hard
Solution
Step 1: Identify the best adaptation method.
Some decision tree algorithms, like C4.5, handle categorical features natively.Step 2: Eliminate wrong options.
One-hot encoding can lead to high dimensionality, label encoding can mislead the model, and PCA is not suitable for categorical data.Final Answer:
Option A -> Option AQuick Check:
Use native categorical support in trees. [OK]
Hint: Use native categorical support in trees. [OK]
Common Mistakes:
5. A retail company wants to use ML to optimize inventory levels. Which approach best frames this business problem as an ML problem?
hard
Solution
Step 1: Identify the core ML task
Predicting future sales based on historical data aligns well with regression, which is suitable for continuous output prediction.Step 2: Eliminate wrong options
Use clustering to group similar products and predict demand is incorrect because clustering is unsupervised and doesn't predict demand. Use classification to categorize products into high and low demand is incorrect because classification is for discrete categories, not continuous predictions. Use reinforcement learning to dynamically adjust inventory levels is incorrect because reinforcement learning is complex and not necessary for static predictions.Final Answer:
Option A -> Option AQuick Check:
Use regression for continuous predictions like sales. [OK]
Hint: Use regression for continuous predictions like sales. [OK]
Common Mistakes:
