
This set of Machine Learning MCQs is about judging and controlling models. It covers confusion matrix arithmetic, precision, recall, specificity and F1 score, ROC curves and AUC, k-fold, stratified and leave-one-out cross-validation, L1, L2 and elastic net regularisation, and min-max and z-score feature scaling. The numerical questions are typical of GATE DA, university semester exams and data science interviews, where metric choice for imbalanced data is a favourite topic.
How to practise: read each question and tap the option you think is correct. You will see right away whether you got it, along with a short explanation, and your score is tracked at the bottom of the screen. This set has 18 questions.
Topics covered in this set
- Confusion matrix, accuracy and specificity
- Precision, recall and F1 score
- ROC curve, AUC and decision thresholds
- k-fold, stratified and leave-one-out cross-validation
- L1 (Lasso), L2 (Ridge) and elastic net
- Min-max normalisation and standardisation
Machine Learning MCQs with answers and explanations
Q1. A binary classifier gives TP = 40, FP = 10, FN = 20 and TN = 30 on a test set. What is its precision?
a) 0.80
b) 0.67
c) 0.70
d) 0.75
Q2. For the same classifier (TP = 40, FP = 10, FN = 20, TN = 30), what is the recall (sensitivity)?
a) 0.80
b) 0.75
c) 0.67
d) 0.57
Q3. A classifier has precision 0.80 and recall 2/3. What is its F1 score (to three decimals)?
F1 = 2PR / (P + R)
a) 0.733
b) 0.727
c) 0.700
d) 0.667
Q4. With TP = 40, FP = 10, FN = 20 and TN = 30, what is the specificity (true negative rate)?
a) 0.67
b) 0.70
c) 0.80
d) 0.75
Q5. In a fraud dataset, 99% of transactions are legitimate. A model that labels every transaction as legitimate reaches 99% accuracy. What is its recall for the fraud class?
a) 0.99
b) 0.50
c) 0
d) 1
Q6. For an early cancer screening test, missing a sick patient is far more costly than a false alarm. Which metric should be prioritised?
a) Recall
b) Precision
c) Specificity
d) Accuracy
Q7. What does a ROC curve plot as the decision threshold varies?
a) Precision against recall
b) True positive rate against false positive rate
c) Accuracy against threshold
d) Training loss against epochs
Q8. A classifier has ROC-AUC = 0.5. What does this indicate?
a) It is a perfect classifier
b) It always predicts the positive class correctly
c) It is worse than any random classifier
d) It ranks positives and negatives no better than random guessing
Q9. In 5-fold cross-validation on a dataset of 1,000 samples, how many samples are used to train each of the five models?
a) 800
b) 200
c) 1000
d) 500
Q10. Why is stratified k-fold cross-validation preferred for imbalanced classification data?
a) It removes the minority class from validation folds
b) It uses a different model in each fold
c) It keeps the class proportions in each fold roughly the same as in the full dataset
d) It guarantees higher accuracy
Q11. How many models are trained in leave-one-out cross-validation on a dataset with n samples?
a) 1
b) 2
c) n/2
d) n
Q12. Which regularisation technique tends to drive some model coefficients exactly to zero, performing implicit feature selection?
a) L2 (Ridge) regularisation
b) L1 (Lasso) regularisation
c) Dropout
d) Early stopping
Q13. In ridge regression the loss is MSE + lambda * sum w_j^2. What happens as lambda is increased from 0 towards a very large value?
a) Weights shrink towards zero, increasing bias and reducing variance
b) Weights grow larger, reducing bias
c) The model becomes identical to Lasso
d) Training error always decreases
Q14. A feature has minimum 10 and maximum 60 in the training set. What is the min-max normalised value of x = 30?
x' = (x - min) / (max - min)
a) 0.50
b) 0.60
c) 0.40
d) 0.33
Q15. A feature has training mean 50 and standard deviation 8. What is the standardised (z-score) value of x = 70?
a) 2.0
b) 2.5
c) 1.4
d) 20
Q16. When positives are extremely rare (for example 0.1% of samples), which evaluation tool usually gives a more informative picture of performance on the positive class?
a) Overall accuracy
b) ROC curve alone
c) Training loss curve
d) Precision-recall curve
Q17. A logistic regression classifier's threshold is raised from 0.5 to 0.8. What is the usual effect?
a) Precision tends to increase and recall tends to decrease
b) Both precision and recall increase
c) Recall increases and precision decreases
d) Neither changes because the model weights are unchanged
Q18. Which regularisation method combines both L1 and L2 penalties in a single objective?
a) Batch normalisation
b) Elastic net
c) Ridge regression
d) Bagging
Quick revision notes
- Accuracy = (TP + TN)/total; Precision = TP/(TP + FP); Recall = TP/(TP + FN).
- Specificity = TN/(TN + FP); FPR = 1 - specificity.
- F1 = 2PR/(P + R), the harmonic mean of precision and recall.
- ROC: TPR vs FPR; AUC = 0.5 random, 1.0 perfect; prefer PR curves for heavy imbalance.
- k-fold CV: each model trains on (k-1)/k of data; LOOCV trains n models.
- L1 (Lasso): sparse weights; L2 (Ridge): small, non-zero weights; Elastic net: both.
- Min-max: (x - min)/(max - min); z-score: (x - mean)/std; fit on training data only.
Frequently asked questions
When should I use precision instead of recall?
Use precision when false positives are expensive, such as flagging genuine emails as spam. Use recall when false negatives are expensive, such as missing a disease or a fraudulent transaction. F1 balances both when neither clearly dominates.
What is the difference between L1 and L2 regularization?
L1 adds the sum of absolute weights to the loss and tends to set some weights exactly to zero, acting as feature selection. L2 adds the sum of squared weights and shrinks all weights smoothly, which works well when many features are useful or correlated.
Why is cross-validation better than a single train-test split?
A single split gives one score that depends on which samples happened to land in the test set. Cross-validation averages scores over several splits, giving a more reliable estimate and making better use of limited data.
Comments
Post a Comment