Machine Learning Machine Learning 3 — Questions and Answers
Question 1: What is the vanishing gradient problem in deep neural networks?
- Gradients become too large and cause unstable training
- Gradients shrink to near zero as they propagate back through layers, halting learning (Correct answer)
- The model forgets earlier training data
- Weights converge too quickly to a local minimum
Correct answer: Gradients shrink to near zero as they propagate back through layers, halting learning
The vanishing gradient problem occurs when gradients become exponentially small during backpropagation through many layers, preventing earlier layers from learning effectively.
Question 2: Which cross-validation strategy is most appropriate for time-series data?
- K-fold cross-validation
- Stratified k-fold
- Walk-forward (time series) cross-validation (Correct answer)
- Leave-one-out cross-validation
Correct answer: Walk-forward (time series) cross-validation
Walk-forward cross-validation respects temporal order by only using past data to predict future data, preventing data leakage from future observations.
Question 3: What is the role of the activation function in a neural network?
- To initialize the weights before training
- To normalize the inputs to each layer
- To introduce non-linearity so the network can learn complex patterns (Correct answer)
- To prevent overfitting by dropping neurons
Correct answer: To introduce non-linearity so the network can learn complex patterns
Activation functions introduce non-linearity into the network, allowing it to learn and represent complex, non-linear relationships in data.
Question 4: Which metric is most suitable for evaluating a model on a highly imbalanced classification dataset?
- Accuracy
- F1-Score (Correct answer)
- Mean Squared Error
- R-squared
Correct answer: F1-Score
F1-Score, the harmonic mean of precision and recall, is preferred for imbalanced datasets because accuracy can be misleadingly high when the majority class dominates.
Question 5: What is transfer learning in machine learning?
- Transferring data between training and test sets
- Using a pre-trained model's learned representations as a starting point for a new task (Correct answer)
- Moving a trained model from one server to another
- Sharing weights between different layers in the same model
Correct answer: Using a pre-trained model's learned representations as a starting point for a new task
Transfer learning leverages knowledge (weights and representations) from a model trained on one task to improve learning on a related but different task.
Question 6: What does 'batch normalization' do in a neural network?
- Randomly drops neurons during each training step
- Normalizes the inputs of each layer to have zero mean and unit variance during training (Correct answer)
- Reduces the number of parameters in the model
- Sets a fixed learning rate for each batch
Correct answer: Normalizes the inputs of each layer to have zero mean and unit variance during training
Batch normalization normalizes layer inputs across the mini-batch, stabilizing and accelerating training by reducing internal covariate shift.
Question 7: In reinforcement learning, what is the 'reward signal'?
- The probability of selecting a given action
- A scalar feedback the agent receives from the environment after each action (Correct answer)
- The agent's internal model of the environment
- The discount factor applied to future states
Correct answer: A scalar feedback the agent receives from the environment after each action
The reward signal is a scalar value the environment provides to the agent after each action, indicating the immediate desirability of that action.
What is the vanishing gradient problem in deep neural networks?