DSE Data Science 4 — Questions and Answers
Question 1: Which of the following is a key assumption of linear regression?
- The target variable must be binary
- Residuals are normally distributed and homoscedastic (Correct answer)
- Features must be uncorrelated with the target
- The model must have at least 1,000 observations
Correct answer: Residuals are normally distributed and homoscedastic
Linear regression assumes that residuals have constant variance (homoscedasticity) and are normally distributed.
Question 2: What problem does the SMOTE technique address in machine learning?
- Multicollinearity among features
- Class imbalance in the training dataset (Correct answer)
- Overfitting caused by too many features
- Slow convergence in gradient descent
Correct answer: Class imbalance in the training dataset
SMOTE (Synthetic Minority Oversampling Technique) generates synthetic samples for the minority class to balance the dataset.
Question 3: In the context of unsupervised learning, what does the silhouette score measure?
- The number of optimal clusters in K-means
- How well each data point fits its own cluster versus neighboring clusters (Correct answer)
- The total within-cluster sum of squares
- The purity of clusters relative to known labels
Correct answer: How well each data point fits its own cluster versus neighboring clusters
The silhouette score ranges from -1 to 1, where higher values indicate well-separated, cohesive clusters.
Question 4: What is the primary advantage of using gradient boosting over random forests?
- Gradient boosting is always faster to train
- It builds trees in parallel to reduce training time
- It sequentially corrects errors from previous trees, often achieving lower bias (Correct answer)
- It requires no hyperparameter tuning
Correct answer: It sequentially corrects errors from previous trees, often achieving lower bias
Gradient boosting fits each new tree to the residuals of the ensemble so far, reducing bias iteratively.
Question 5: Which metric is best suited for evaluating a regression model's performance?
- F1-Score
- Root Mean Squared Error (RMSE) (Correct answer)
- Area Under the ROC Curve
- Matthews Correlation Coefficient
Correct answer: Root Mean Squared Error (RMSE)
RMSE measures the average magnitude of prediction errors in the same units as the target variable.
Question 6: What is the purpose of the train-validation-test split in machine learning?
- To ensure the model sees all data at some point during training
- To use training for learning, validation for hyperparameter tuning, and test for final unbiased evaluation (Correct answer)
- To reduce training time by using smaller datasets
- To prevent class imbalance from affecting model performance
Correct answer: To use training for learning, validation for hyperparameter tuning, and test for final unbiased evaluation
Keeping a held-out test set ensures the final performance estimate is unbiased by any model selection decisions.
Question 7: In a neural network, what is the vanishing gradient problem?
- Gradients become too large and cause weight updates to diverge
- Gradients shrink exponentially through layers, slowing learning in early layers (Correct answer)
- The loss function fails to converge during backpropagation
- Dropout randomly zeroes gradients, reducing effective learning
Correct answer: Gradients shrink exponentially through layers, slowing learning in early layers
When gradients approach zero during backpropagation, early layers learn very slowly or not at all.
Which of the following is a key assumption of linear regression?