DAC Machine Learning & Predictive Analytics 2 — Questions and Answers
Question 1: A model achieves 99% accuracy on training data but only 62% on test data. What is the most likely problem?
- Overfitting (Correct answer)
- Underfitting
- Class imbalance
- Data leakage from the test set
Correct answer: Overfitting
A large gap between high training accuracy and low test accuracy is the classic signature of overfitting.
Question 2: Which technique is most appropriate for reducing overfitting in a decision tree?
- Increasing tree depth
- Pruning the tree (Correct answer)
- Adding more leaf nodes
- Removing cross-validation
Correct answer: Pruning the tree
Pruning removes branches that add little predictive power, reducing complexity and overfitting.
Question 3: In a confusion matrix for a fraud detection model, what does a false negative represent?
- A legitimate transaction flagged as fraud
- A fraudulent transaction missed by the model (Correct answer)
- A correctly identified fraud
- A correctly identified legitimate transaction
Correct answer: A fraudulent transaction missed by the model
A false negative is an actual positive (fraud) that the model incorrectly labeled as negative (legitimate).
Question 4: Which metric is best when the cost of missing positive cases is very high, such as disease screening?
- Precision
- Recall (Correct answer)
- Accuracy
- Specificity
Correct answer: Recall
Recall measures the proportion of actual positives caught, which matters most when missing them is costly.
Question 5: What is the primary purpose of feature scaling before applying k-nearest neighbors?
- To reduce the number of features
- To ensure all features contribute equally to distance calculations (Correct answer)
- To convert categorical data to numeric
- To remove outliers
Correct answer: To ensure all features contribute equally to distance calculations
KNN relies on distance, so features on larger scales would otherwise dominate the calculation.
Question 6: A regression model has a high R-squared but residuals show a clear curved pattern. What does this indicate?
- The model is perfect
- A nonlinear relationship is not being captured (Correct answer)
- The data has no relationship
- Multicollinearity is present
Correct answer: A nonlinear relationship is not being captured
Systematic curvature in residuals signals that a linear model is missing a nonlinear relationship.
Question 7: Which algorithm is an example of an ensemble method that combines many weak learners sequentially?
- K-means
- Gradient boosting (Correct answer)
- Linear regression
- Principal component analysis
Correct answer: Gradient boosting
Gradient boosting builds trees sequentially, each correcting errors of the previous ones.
A model achieves 99% accuracy on training data but only 62% on test data.
What is the most likely problem?