Practice
1. When choosing between K-Means and Gaussian Mixture Models (GMM) for clustering, which scenario favors K-Means?
medium
Solution
Step 1: Compare K-Means and GMM
K-Means assumes spherical clusters with similar variance, while GMM can handle different shapes and densities.Step 2: Identify the scenario
Clusters with similar variance and spherical shape describes clusters with similar variance and spherical shape, which is ideal for K-Means.Final Answer:
Option D -> Option DQuick Check:
K-Means loves spherical, similar variance clusters [OK]
Hint: K-Means loves spherical, similar variance clusters [OK]
Common Mistakes:
2. A Transformer model is underperforming on a sequence prediction task. The model seems to ignore the order of words. What is the most likely cause?
medium
Solution
Step 1: Identify symptoms
The model ignoring word order suggests an issue with positional encoding, which provides order information.Step 2: Eliminate wrong options
The model's learning rate is too high is incorrect because learning rate affects convergence, not order. The self-attention mechanism is not capturing dependencies is incorrect because self-attention captures dependencies, not order. The model has too few layers is incorrect because layer count affects capacity, not order.Final Answer:
Option C -> Option CQuick Check:
Order issues? Check positional encoding. [OK]
Hint: Order issues? Check positional encoding. [OK]
Common Mistakes:
3. You are designing a neural network for a real-time application with strict latency requirements. Which activation function would you choose and why?
hard
Solution
Step 1: Consider latency requirements.
Real-time applications need fast computations.Step 2: Evaluate each activation function.
ReLU is computationally efficient due to its simple max(0, x) operation. Sigmoid and Tanh are slower due to exponential calculations. GELU, while accurate, is more complex.Final Answer:
Option B -> Option BQuick Check:
ReLU: fast, simple, real-time ready. [OK]
Hint: ReLU: fast, simple, real-time ready. [OK]
Common Mistakes:
4. In a real-time prediction system, how should you handle data splits to ensure both model performance and system efficiency?
hard
Solution
Step 1: Consider real-time constraints
Real-time systems need to adapt to new data while maintaining performance.Step 2: Evaluate options for adaptability and efficiency
Use a single train-test split to minimize latency. risks overfitting. Use a large test set to ensure model robustness. misallocates resources. Use a static validation set to simplify the system. lacks adaptability to new data.Final Answer:
Option D -> Option DQuick Check:
Rolling window adapts to new data efficiently. [OK]
Hint: Rolling window adapts to new data efficiently. [OK]
Common Mistakes:
5. In a real-time system where predictions need to be made quickly, which approach to linear regression is more suitable and why?
hard
Solution
Step 1: Consider real-time constraints
Stochastic Gradient Descent (SGD) updates weights after each data point, allowing for faster, more frequent updates suitable for real-time systems.Step 2: Eliminate wrong options
Batch Gradient Descent (A) is too slow for real-time, Least Squares (C) is not iterative, and Mini-batch (D) is a compromise but not as fast as SGD.Final Answer:
Option A -> Option AQuick Check:
SGD updates weights after each data point. [OK]
Hint: SGD updates weights after each data point. [OK]
Common Mistakes:
