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.
import pandas as pd
from sklearn.impute import SimpleImputer
# Sample data
data = {'A': [1, 2, None, 4], 'B': [None, 2, 3, 4]}
df = pd.DataFrame(data)
# Imputation
imputer = SimpleImputer(strategy='mean')
imputed_data = imputer.fit_transform(df)
print(imputed_data)What is the output of the above code?easy
Solution
Step 1: Calculate the mean for each column
Column A mean: (1+2+4)/3 = 2.333, Column B mean: (2+3+4)/3 = 3.0Step 2: Apply mean imputation
Replace missing values with calculated means.Final Answer:
Option A -> Option AQuick Check:
Mean replaces NaN [OK]
Hint: Mean replaces NaN [OK]
Common Mistakes:
3. A decision tree model is overfitting the training data. What is the most likely cause?
medium
Solution
Step 1: Identify overfitting causes.
Overfitting often occurs when the model is too complex, such as a deep tree.Step 2: Eliminate wrong options.
A shallow tree would underfit, a small dataset affects generalization but not directly overfitting, and uninformative features would lead to poor performance, not overfitting.Final Answer:
Option D -> Option DQuick Check:
Deep trees overfit easily. [OK]
Hint: Deep trees overfit easily. [OK]
Common Mistakes:
4. When choosing between polynomial features and interaction terms for a linear model, which is more appropriate when the dataset is small and why?
medium
Solution
Step 1: Consider dataset size and model complexity.
Small datasets are prone to overfitting with complex models.Step 2: Evaluate the impact of each option.
Polynomial features (A, C) increase complexity significantly, leading to overfitting. Interaction terms (B, D) add complexity but less than polynomial features, making them more suitable for small datasets.Final Answer:
Option D -> Option DQuick Check:
Small data: prefer interaction terms to avoid overfitting. [OK]
Hint: Small data: prefer interaction terms to avoid overfitting. [OK]
Common Mistakes:
5. A company implemented an ML model to predict customer churn but found that the model's predictions were not improving business outcomes. What is the most likely root cause?
medium
Solution
Step 1: Identify the mismatch
If the model's predictions are not improving business outcomes, it is likely that the business problem was not correctly translated into an ML problem.Step 2: Eliminate wrong options
The model is overfitting the training data is incorrect because overfitting would affect prediction accuracy, not business alignment. The model's hyperparameters were not optimized is incorrect because hyperparameter tuning affects model performance, not problem alignment. The dataset used was too small is incorrect because data size affects model accuracy, not problem framing.Final Answer:
Option B -> Option BQuick Check:
Align ML problem with business goals for impact. [OK]
Hint: Align ML problem with business goals for impact. [OK]
Common Mistakes:
