Practice
1. In the context of Convolutional Neural Networks, what is the primary purpose of pooling layers?
easy
Solution
Step 1: Understand pooling layers
Pooling layers are used to reduce the spatial dimensions of feature maps, which helps in reducing computation and controlling overfitting.Step 2: Eliminate wrong options
To increase the size of the feature maps is incorrect because pooling reduces size, not increases it. To increase the number of channels in the feature maps is incorrect as pooling doesn't change the number of channels. To apply non-linear activation functions is incorrect because pooling doesn't apply non-linear activations.Final Answer:
Option A -> Option AQuick Check:
Pooling reduces spatial dimensions. [OK]
Hint: Pooling reduces spatial dimensions. [OK]
Common Mistakes:
2. Given the following Python code using Naive Bayes, what will be the output?
from sklearn.naive_bayes import GaussianNB
import numpy as np
X = np.array([[1, 2], [2, 3], [3, 4]])
y = np.array([1, 0, 1])
model = GaussianNB()
model.fit(X, y)
print(model.predict([[2, 2]]))easy
Solution
Step 1: Understand the Code Execution
The code fits a Gaussian Naive Bayes model and predicts the class for a new sample [2, 2].Step 2: Analyze the Prediction
Given the training data, the model predicts class 1 for [2, 2] based on the likelihoods.Final Answer:
Option A -> Option AQuick Check:
GaussianNB predicts based on likelihoods. [[check]]
Hint: GaussianNB predicts based on likelihoods. [[check]]
Common Mistakes:
3. A model performs well overall but poorly on a specific slice of data. What is the most likely cause?
medium
Solution
Step 1: Analyze the problem
Poor performance on a specific slice often indicates distribution mismatch.Step 2: Eliminate wrong options
The model is overfitting to the training data. is incorrect as overfitting would affect overall performance. The model has too many parameters. is unrelated to slice-specific issues. The learning rate is too high. affects convergence, not slice performance.Final Answer:
Option A -> Option AQuick Check:
Slice mismatch = distribution issue. [OK]
Hint: Slice mismatch = distribution issue. [OK]
Common Mistakes:
4. When should you avoid using Naive Bayes despite its simplicity and speed?
medium
Solution
Step 1: Identify Naive Bayes Limitations
Naive Bayes assumes feature independence given the class label.Step 2: Evaluate Each Option
When the dataset is very large. is incorrect because Naive Bayes handles large datasets well. When you need a probabilistic output. is incorrect because Naive Bayes provides probabilistic outputs. When the dataset has missing values. is incorrect because Naive Bayes can handle missing values with some preprocessing.Final Answer:
Option D -> Option DQuick Check:
Correlated features break Naive Bayes. [[check]]
Hint: Correlated features break Naive Bayes. [[check]]
Common Mistakes:
5. When considering bias mitigation strategies, which approach is more suitable for a scenario where you cannot alter the training data but need to ensure fairness in predictions?
medium
Solution
Step 1: Identify the constraint.
Cannot alter training data, need fairness in predictions.Step 2: Choose the suitable technique.
Post-processing techniques adjust predictions to ensure fairness without altering the model or data.Final Answer:
Option D -> Option DQuick Check:
Post-processing adjusts predictions, not data. [OK]
Hint: Post-processing adjusts predictions, not data. [OK]
Common Mistakes:
