Model Selection, Cross-validation and Performance Metrics Notes for Gate Da
Model Selection, Cross-validation and Performance Metrics notes for GATE DA: 34 study cards covering concepts, formulas, shortcuts and exam traps, plus solved
Model Selection Cross Validation and Performance Metrics notes
Chapter Roadmap: Model Selection, Cross-Validation and Performance Metrics
Chapter Roadmap
Master the art of evaluating machine learning models. By the end of this chapter, you will know how to reliably estimate generalization error and choose the best performing model.
1. Cross-Validation and Model Selection (Part 1)
K-Fold, LOOCV, and the bias-variance tradeoff in evaluation. Weightage: Moderate
2. Cross-Validation and Model Selection (Part 2)
Stratified sampling and practical model selection pipelines. Weightage: High
3. Classification Performance Metrics (Part 1)
Confusion matrix, Precision, Recall, and Accuracy. Weightage: Moderate
4. Classification Performance Metrics (Part 2)
F1 Score, ROC curves, and Area Under the Curve (AUC). Weightage: High
Cross-Validation and Model Selection
Why this matters: A single train-test split can give a misleading estimate of model performance due to random chance. Cross-validation systematically rotates the data, providing a robust, reliable measure of how your model will generalize to unseen data.
What you will learn here:
The fundamental flaw of a single holdout set.
The mechanics of K-Fold and Leave-One-Out Cross-Validation.
The bias-variance tradeoff in choosing the number of folds, K.
How to avoid the critical trap of data leakage during preprocessing.
The Need for Cross-Validation
The Need for Cross-Validation
When evaluating a model, the gold standard is to test it on data it has never seen during training. The simplest approach is a single train-test split (holdout method).
However, a single split has a major flaw: high variance in the performance estimate. Depending on how the data is randomly shuffled, the test set might be unusually easy or unusually hard. This "luck of the draw" can lead to overestimating or underestimating the model's true generalization ability.
The Solution: Cross-validation systematically rotates which data is used for training and which is used for validation. This ensures every data point contributes to both training and evaluation, yielding a much more stable and reliable error estimate.
31 more cards in this chapter
Try a question
Answer it here to see how it works. Nothing is recorded until you sign in.
Question 1
Level 1: Warm-up
A classifier evaluates a dataset with 100 positive and 100 negative samples. It achieves a Precision of 0.8 and a Recall of 0.6. What is the minimum number of True Negatives?
Question 2
Level 1: Warm-up
Match the cross-validation method with the number of validation splits it generates on a training pool of size Ntrain.
P: Hold-out
Q: k-fold
R: LOOCV
1: $1$
2: k
3: Ntrain
Question 3
Level 1: Warm-up
A machine learning practitioner uses Leave-One-Out Cross-Validation (LOOCV) on a training pool and obtains exactly 450 validation splits. If 50 samples were strictly held out as a final test set, what is the total number of samples N in the original dataset?
Question 4
Level 1: Warm-up
Match the cross-validation scenario with the exact number of validation splits it generates.
P: N=1000, Ntest=200, $5$-fold CV on the training pool.
Q: N=500, no separate test set, Leave-One-Out CV (LOOCV).
R: N=800, 80/20 single hold-out validation split.
1: $1$
2: $5$
3: $400$
4: $500$
Question 5
Level 1: Warm-up
In a Leave-One-Out Cross-Validation (LOOCV) process on a training pool, the total number of sample-uses for training across all splits combined is $2450$. If the original dataset had $10$ samples strictly held out for testing, what is the total number of samples $N$ in the original dataset?
Question 6
Level 1: Warm-up
Which of the following statements correctly bounds the Precision of a classifier that predicts the positive class for every single sample in a dataset with P actual positives and N actual negatives?
Question 7
Level 1: Warm-up
Assertion (A): The F1 score of a classifier is exactly $0.5$ if its Precision is $1.0$ and its Recall is $0.0$.
Reason (R): The F1 score is calculated as the arithmetic mean of Precision and Recall.
Which of the following is correct?
Question 8
Level 1: Warm-up
A classifier evaluates $100$ stories. The actual number of stories by Author X is $40$. The classifier achieves a Recall of $0.75$ for Author X. How many stories by Author X were incorrectly classified as not being by Author X?
Question 9
Level 1: Warm-up
A classifier predicts 40 samples as Positive and 60 as Negative. The actual number of Positive samples is 35. If the True Positives are 25, what is the number of False Positives?
Question 10
Level 1: Warm-up
Which of the following statements is strictly true regarding the F1 score of a classifier?
Free preview ends here
Login to view the complete notes
Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.
Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.
Built around you, not around a syllabus PDF
Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.
Revision that hits your weak spots
We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.
Questions calibrated to the real exam
Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.
Notes written for recall, not for volume
Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.
One place for everything
Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.
Honest progress
No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.
Unlock the whole course
Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.
Model Selection, Cross-validation and Performance Metrics Notes for GATE DA
Model Selection, Cross-validation and Performance Metrics notes for GATE DA: 34 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.
Chapter Roadmap: Model Selection, Cross-Validation and Performance Metrics
Chapter Roadmap
Master the art of evaluating machine learning models. By the end of this chapter, you will know how to reliably estimate generalization error and choose the best performing model.
1. Cross-Validation and Model Selection (Part 1)
K-Fold, LOOCV, and the bias-variance tradeoff in evaluation. Weightage: Moderate
2. Cross-Validation and Model Selection (Part 2)
Stratified sampling and practical model selection pipelines. Weightage: High
3. Classification Performance Metrics (Part 1)
Confusion matrix, Precision, Recall, and Accuracy. Weightage: Moderate
4. Classification Performance Metrics (Part 2)
F1 Score, ROC curves, and Area Under the Curve (AUC). Weightage: High
Cross-Validation and Model Selection
Why this matters: A single train-test split can give a misleading estimate of model performance due to random chance. Cross-validation systematically rotates the data, providing a robust, reliable measure of how your model will generalize to unseen data.
What you will learn here:
The fundamental flaw of a single holdout set.
The mechanics of K-Fold and Leave-One-Out Cross-Validation.
The bias-variance tradeoff in choosing the number of folds, K.
How to avoid the critical trap of data leakage during preprocessing.
The Need for Cross-Validation
The Need for Cross-Validation
When evaluating a model, the gold standard is to test it on data it has never seen during training. The simplest approach is a single train-test split (holdout method).
However, a single split has a major flaw: high variance in the performance estimate. Depending on how the data is randomly shuffled, the test set might be unusually easy or unusually hard. This "luck of the draw" can lead to overestimating or underestimating the model's true generalization ability.
The Solution: Cross-validation systematically rotates which data is used for training and which is used for validation. This ensures every data point contributes to both training and evaluation, yielding a much more stable and reliable error estimate.
K-Fold Cross-Validation Mechanics
K-Fold Cross-Validation Mechanics
K-Fold Cross-Validation is the standard procedure for robust model evaluation. The algorithm proceeds as follows:
Shuffle: Randomly shuffle the entire dataset to remove any inherent ordering.
Split: Divide the dataset into K equal-sized (or nearly equal-sized) subsets, called folds.
Iterate: For i=1 to K:
Use fold i as the validation set.
Use the remaining K−1 folds as the training set.
Train the model and record the validation error Ei.
Average: The final cross-validation error estimate is the average of the K errors:
ECV=K1i=1∑KEi
This guarantees that every single data point is used for validation exactly once, and for training exactly K−1 times.
Model Selection, Cross-validation and Performance Metrics: Solved Questions with Step-by-Step Explanations (10 Problems)
Question 1 · Machine LearningMCQ
A classifier evaluates a dataset with 100 positive and 100 negative samples. It achieves a Precision of 0.8 and a Recall of 0.6. What is the minimum number of True Negatives?
A.
15
B.
40
C.
85
D.
115
Correct Answer:
C
Step-by-Step Solution
Key idea: This is a contradiction/resolution question where you must use the fixed definitions of Precision and Recall to find the exact confusion matrix cells.
Step 1: Use Recall to find TP and FN. Recall = TP / (TP + FN) = TP / Actual Positives. Since Actual Positives = 100, 0.6=TP/100⟹TP=60. Thus, FN=100−60=40.
Step 2: Use Precision to find FP. Precision = TP / (TP + FP). 0.8=60/(60+FP)⟹60+FP=60/0.8=75⟹FP=15.
Step 3: Calculate TN. TN = Actual Negatives - FP. Since Actual Negatives = 100, TN=100−15=85.
Answer: 85
Question 2 · Machine LearningMCQ
Match the cross-validation method with the number of validation splits it generates on a training pool of size Ntrain.
P: Hold-out
Q: k-fold
R: LOOCV
1: $1$
2: k
3: Ntrain
A.
P-1, Q-2, R-3
B.
P-2, Q-1, R-3
C.
P-1, Q-3, R-2
D.
P-3, Q-2, R-1
Correct Answer:
A
Step-by-Step Solution
Key idea: Each validation method has a fixed rule for the number of splits it produces.
Step 1: Hold-out splits data once into train and validation, yielding exactly $1$ split. (P matches 1)
Step 2: $k$-fold cross-validation divides data into $k$ folds, yielding exactly $k$ splits. (Q matches 2)
Step 3: LOOCV uses each of the $N_{train}$ samples as a validation set once, yielding $N_{train}$ splits. (R matches 3)
Answer: P-1, Q-2, R-3
Question 3 · Machine LearningMCQ
A machine learning practitioner uses Leave-One-Out Cross-Validation (LOOCV) on a training pool and obtains exactly 450 validation splits. If 50 samples were strictly held out as a final test set, what is the total number of samples N in the original dataset?
A.
450
B.
500
C.
400
D.
50
Correct Answer:
B
Step-by-Step Solution
Key idea: LOOCV generates a number of splits equal to the size of the training pool (Ntrain). The total dataset size is the sum of the training pool and the test set.
Step 1: Identify Ntrain from the LOOCV splits. Since splits = Ntrain, we have Ntrain=450.
Step 2: Identify the test set size: Ntest=50.
Step 3: Calculate total samples N=Ntrain+Ntest=450+50=500.
Answer: 500
Question 4 · Machine LearningMCQ
Match the cross-validation scenario with the exact number of validation splits it generates.
P: N=1000, Ntest=200, $5$-fold CV on the training pool.
Q: N=500, no separate test set, Leave-One-Out CV (LOOCV).
R: N=800, 80/20 single hold-out validation split.
1: $1$
2: $5$
3: $400$
4: $500$
A.
P-2, Q-4, R-1
B.
P-3, Q-4, R-1
C.
P-2, Q-3, R-1
D.
P-4, Q-3, R-2
Correct Answer:
A
Step-by-Step Solution
Key idea: Each validation method has a fixed rule for the number of splits it produces, independent of N (except LOOCV).
Step 1: Scenario P uses $5$-fold CV. By definition, this generates exactly $5$ splits. (P matches 2)
Step 2: Scenario Q uses LOOCV on N=500 with no test set. The training pool is $500$, so LOOCV generates $500$ splits. (Q matches 4)
Step 3: Scenario R uses a single hold-out split. This always generates exactly $1$ split. (R matches 1)
Answer: P-2, Q-4, R-1
Question 5 · Machine LearningMCQ
In a Leave-One-Out Cross-Validation (LOOCV) process on a training pool, the total number of sample-uses for training across all splits combined is $2450$. If the original dataset had $10$ samples strictly held out for testing, what is the total number of samples $N$ in the original dataset?
A.
49
B.
50
C.
60
D.
2460
Correct Answer:
C
Step-by-Step Solution
Key idea: In LOOCV, the number of splits equals Ntrain, and each split trains on Ntrain−1 samples.
Step 1: Let x=Ntrain. The total sample-uses for training across all splits is x×(x−1).
Step 2: Set up the equation: x(x−1)=2450.
Step 3: Solve for x. We know 50×49=2450, so x=50. Thus, Ntrain=50.
Step 4: Calculate total samples N=Ntrain+Ntest=50+10=60.
Answer: 60
Question 6 · Machine LearningMCQ
Which of the following statements correctly bounds the Precision of a classifier that predicts the positive class for every single sample in a dataset with P actual positives and N actual negatives?
A.
Precision is exactly $1.0$.
B.
Precision is exactly N/(P+N).
C.
Precision is exactly P/(P+N).
D.
Precision is bounded between $0.5$ and $1.0$.
Correct Answer:
C
Step-by-Step Solution
Key idea: Precision is the ratio of True Positives to all Predicted Positives.
Step 1: If the model predicts Positive for every sample, then Predicted Positives = P+N.
Step 2: The True Positives (TP) will be exactly the actual positives, so TP = P.
Step 3: Precision = TP / (TP + FP) = P/(P+N).
Answer: Precision is exactly P/(P+N).
Question 7 · Machine LearningMCQ
Assertion (A): The F1 score of a classifier is exactly $0.5$ if its Precision is $1.0$ and its Recall is $0.0$.
Reason (R): The F1 score is calculated as the arithmetic mean of Precision and Recall.
Which of the following is correct?
A.
Both A and R are true, and R is the correct explanation of A.
B.
Both A and R are true, but R is NOT the correct explanation of A.
C.
A is true, but R is false.
D.
Both A and R are false.
Correct Answer:
D
Step-by-Step Solution
Key idea: The F1 score is the harmonic mean, not the arithmetic mean, of Precision and Recall.
Step 1: Evaluate Assertion (A). The harmonic mean of 1.0 and 0.0 is 0.0, not 0.5. Thus, A is false.
Step 2: Evaluate Reason (R). The F1 score uses the harmonic mean formula: 2×P+RP×R. It is not the arithmetic mean. Thus, R is false.
Answer: Both A and R are false.
Question 8 · Machine LearningMCQ
A classifier evaluates $100$ stories. The actual number of stories by Author X is $40$. The classifier achieves a Recall of $0.75$ for Author X. How many stories by Author X were incorrectly classified as not being by Author X?
A.
10
B.
30
C.
40
D.
75
Correct Answer:
A
Step-by-Step Solution
Key idea: Recall measures the proportion of actual positives that were correctly identified. The incorrectly classified actual positives are False Negatives.
Step 1: Identify the total actual positives for Author X: P=40.
Step 4: Calculate False Negatives (FN): Total actual positives - TP = 40−30=10.
Answer: 10
Question 9 · Machine LearningMCQ
A classifier predicts 40 samples as Positive and 60 as Negative. The actual number of Positive samples is 35. If the True Positives are 25, what is the number of False Positives?
A.
5
B.
15
C.
25
D.
35
Correct Answer:
B
Step-by-Step Solution
Key idea: This is a casework confusion matrix question where you must isolate the predicted positive column to find False Positives.
Step 1: Identify the total number of samples predicted as Positive. The problem states this is 40.
Step 2: Recall that all samples predicted as Positive are either True Positives (TP) or False Positives (FP). Therefore, Predicted Positives = TP + FP.
Step 3: Substitute the known values: 40=25+FP.
Step 4: Solve for FP: FP=40−25=15.
Answer: 15
Question 10 · Machine LearningMCQ
Which of the following statements is strictly true regarding the F1 score of a classifier?
A.
The F1 score is bounded between 0.0 and 1.0, inclusive.
B.
The F1 score is always greater than or equal to the arithmetic mean of Precision and Recall.
C.
The F1 score can be 1.0 even if the Recall is 0.0.
D.
The F1 score is equal to the Accuracy when the dataset is perfectly balanced.
Correct Answer:
A
Step-by-Step Solution
Key idea: This is a bounding question testing the mathematical properties and constraints of the harmonic mean used in the F1 score.
Step 1: Evaluate Option A. Precision and Recall are both bounded between 0.0 and 1.0. The harmonic mean of two numbers in [0,1] is also strictly bounded in [0,1]. This statement is true.
Step 2: Evaluate Option B. The harmonic mean is always less than or equal to the arithmetic mean, not greater. This statement is false.
Step 3: Evaluate Option C. If Recall is 0.0, the numerator of the F1 formula (2×P×R) becomes 0, making the F1 score exactly 0.0. This statement is false.
Step 4: Evaluate Option D. The F1 score only equals Accuracy under very specific symmetric conditions, not universally just because the dataset is balanced. This statement is false.
Answer: The F1 score is bounded between 0.0 and 1.0, inclusive.