MS-DS Master of Data science Master of Data Science 2 — Questions and Answers
Question 1: Which regularization technique adds the sum of absolute values of coefficients as a penalty term to the loss function?
- Ridge (L2)
- Lasso (L1) (Correct answer)
- Elastic Net
- Dropout
Correct answer: Lasso (L1)
Lasso (L1) regularization penalizes the sum of absolute values of coefficients, which can drive some coefficients exactly to zero, performing feature selection.
Question 2: In the context of Bayesian inference, what does the prior distribution represent?
- The likelihood of observed data given parameters
- Beliefs about parameters before observing data (Correct answer)
- The posterior after updating with data
- The marginal distribution of the data
Correct answer: Beliefs about parameters before observing data
The prior distribution encodes beliefs or knowledge about model parameters before any data is observed.
Question 3: Which SQL window function returns the rank of a row within a partition, with no gaps in ranking values?
- RANK()
- DENSE_RANK() (Correct answer)
- ROW_NUMBER()
- NTILE()
Correct answer: DENSE_RANK()
DENSE_RANK() assigns consecutive ranks without gaps, whereas RANK() skips values when ties occur.
Question 4: What is the time complexity of training a k-Nearest Neighbors classifier on n training samples with d features?
- O(n log n)
- O(d log d)
- O(1) training, O(nd) at prediction (Correct answer)
- O(nd) training, O(1) at prediction
Correct answer: O(1) training, O(nd) at prediction
kNN is a lazy learner — training is O(1) since it just stores data, but each prediction requires computing distances to all n points across d features.
Question 5: In a neural network, what problem occurs when gradients become exponentially small as they propagate backward through many layers?
- Overfitting
- Exploding gradient
- Vanishing gradient (Correct answer)
- Covariate shift
Correct answer: Vanishing gradient
The vanishing gradient problem causes gradients to shrink exponentially during backpropagation, making it difficult to train deep networks.
Question 6: Which metric is most appropriate for evaluating a classification model when the dataset has severe class imbalance?
- Accuracy
- F1-Score (Correct answer)
- Mean Squared Error
- R-squared
Correct answer: F1-Score
F1-Score balances precision and recall, making it far more informative than accuracy when one class vastly outnumbers another.
Question 7: What does the 'curse of dimensionality' primarily refer to in machine learning?
- Overly complex neural network architectures
- The exponential growth of data needed as feature dimensions increase (Correct answer)
- Running out of GPU memory during training
- Too many hyperparameters to tune
Correct answer: The exponential growth of data needed as feature dimensions increase
As dimensionality increases, the volume of space grows so rapidly that data becomes sparse, making distance-based methods and density estimation unreliable.
Which regularization technique adds the sum of absolute values of coefficients as a penalty term to the loss function?