Machine Learning Machine Learning 4 — Questions and Answers
Question 1: What is the difference between generative and discriminative models?
- Generative models classify data; discriminative models generate new data
- Generative models learn the joint distribution P(X,Y); discriminative models learn the conditional P(Y|X) (Correct answer)
- Generative models use supervised learning; discriminative models use unsupervised learning
- Generative models require more labeled data than discriminative models
Correct answer: Generative models learn the joint distribution P(X,Y); discriminative models learn the conditional P(Y|X)
Generative models learn the joint distribution of inputs and labels to model how data is generated, while discriminative models directly learn the boundary between classes.
Question 2: What is the elbow method used for in clustering?
- Selecting the optimal learning rate for k-means
- Determining the optimal number of clusters by identifying where inertia reduction slows (Correct answer)
- Evaluating silhouette scores across different algorithms
- Identifying outliers before clustering
Correct answer: Determining the optimal number of clusters by identifying where inertia reduction slows
The elbow method plots within-cluster inertia against the number of clusters (k) and looks for a kink where adding more clusters yields diminishing returns.
Question 3: Which of the following best describes 'data leakage' in a machine learning pipeline?
- Accidentally deleting training data
- Information from outside the training set improperly influencing model training, leading to overly optimistic evaluation (Correct answer)
- A model memorizing the training data
- Sensitive data being exposed to unauthorized users
Correct answer: Information from outside the training set improperly influencing model training, leading to overly optimistic evaluation
Data leakage occurs when information from the test set or future data influences model training or preprocessing, causing inflated performance metrics that don't generalize.
Question 4: What is the purpose of dropout in neural network training?
- To remove neurons with low activation values permanently
- To randomly deactivate neurons during training to prevent co-adaptation and reduce overfitting (Correct answer)
- To speed up training by skipping certain layers
- To normalize activations across the batch
Correct answer: To randomly deactivate neurons during training to prevent co-adaptation and reduce overfitting
Dropout randomly sets a fraction of neuron activations to zero during each training step, forcing the network to learn redundant representations and reducing overfitting.
Question 5: In gradient boosting, what does the 'learning rate' (shrinkage) control?
- The depth of each decision tree
- The number of trees in the ensemble
- The contribution of each tree to the final prediction, scaling down its effect (Correct answer)
- The fraction of training samples used per tree
Correct answer: The contribution of each tree to the final prediction, scaling down its effect
The learning rate in gradient boosting scales the contribution of each new tree, helping prevent overfitting by requiring more trees to achieve the same fit.
Question 6: What is the curse of dimensionality?
- The computational cost of training on large datasets
- The phenomenon where high-dimensional spaces make data sparse, degrading distance-based algorithms (Correct answer)
- The inability of models to learn from more than 100 features
- The exponential growth of model parameters with depth
Correct answer: The phenomenon where high-dimensional spaces make data sparse, degrading distance-based algorithms
As dimensionality increases, data becomes increasingly sparse and distances between points become less meaningful, causing many ML algorithms to degrade in performance.
Question 7: Which type of neural network architecture is specifically designed for sequential data like text and time series?
- Convolutional Neural Network (CNN)
- Recurrent Neural Network (RNN) (Correct answer)
- Generative Adversarial Network (GAN)
- Autoencoder
Correct answer: Recurrent Neural Network (RNN)
RNNs maintain hidden state across sequence steps, making them suited for modeling temporal dependencies in sequential data like language or time series.
What is the difference between generative and discriminative models?