Practice
1. In the context of the bias-variance tradeoff, which of the following is a characteristic of a high-bias model?
easy
Solution
Step 1: Identify characteristics of high-bias models
High-bias models are typically simple and underfit the training data.Step 2: Eliminate wrong options
It has high flexibility and can fit the training data well. describes high-variance models. It has high variance and is sensitive to noise in the training data. is incorrect as it describes high-variance models. It performs well on both training and unseen data. is incorrect because high-bias models do not perform well on training data.Final Answer:
Option A -> Option AQuick Check:
High-bias models underfit. [OK]
Hint: High-bias models underfit. [OK]
Common Mistakes:
2.
import torch
import torch.nn as nn
conv = nn.Conv2d(in_channels=1, out_channels=1, kernel_size=3, stride=1, padding=0)
input_tensor = torch.ones((1, 1, 5, 5))
output_tensor = conv(input_tensor)
print(output_tensor.shape)What is the output shape of the output_tensor?easy
Solution
Step 1: Calculate output dimensions
Using the formula: ((W - F + 2P) / S) + 1, where W=5, F=3, P=0, S=1, the output size is ((5-3+0)/1)+1 = 3.Step 2: Eliminate wrong options
(1, 1, 5, 5) is incorrect because the size doesn't remain the same. (1, 1, 4, 4) is incorrect because it assumes incorrect padding. (1, 1, 2, 2) is incorrect due to incorrect calculation.Final Answer:
Option D -> Option DQuick Check:
Use output size formula for CNNs. [OK]
Hint: Use output size formula for CNNs. [OK]
Common Mistakes:
3. You need to reduce the dimensionality of a dataset with 10,000 features for a real-time application. Which technique is more suitable and why?
medium
Solution
Step 1: Consider computational efficiency
Real-time applications require fast computations.Step 2: Evaluate each option
t-SNE is computationally expensive, UMAP is faster but still slower than PCA, and LDA is not suitable for unsupervised tasks.Final Answer:
Option B -> Option BQuick Check:
PCA for speed in large datasets [OK]
Hint: PCA for speed in large datasets [OK]
Common Mistakes:
4. You notice that your LSTM model is not learning effectively and suspect vanishing gradients. What is a likely cause specific to LSTM architecture?
medium
Solution
Step 1: Identify LSTM-specific issues.
Incorrect initialization of forget gate biases can lead to vanishing gradients.Step 2: Eliminate wrong options.
Too many layers can cause vanishing gradients, but it's not LSTM-specific. High learning rates cause exploding gradients, and dropout affects overfitting, not gradient flow.Final Answer:
Option A -> Option AQuick Check:
Forget gate bias affects gradient flow. [OK]
Hint: Forget gate bias affects gradient flow. [OK]
Common Mistakes:
5. You are tasked with deploying a calibrated model for a real-time fraud detection system. Which approach ensures both calibration and low latency?
hard
Solution
Step 1: Consider latency and calibration.
Real-time systems require low latency, favoring pre-trained models.Step 2: Evaluate each approach.
Batch processing (A) and online learning (B) introduce latency. Pre-trained models (C, D) are faster, but Platt Scaling (C) is more efficient than Isotonic Regression (D).Final Answer:
Option A -> Option AQuick Check:
Pre-trained + Platt = fast calibration. [OK]
Hint: Pre-trained + Platt = fast calibration. [OK]
Common Mistakes:
