Bias-Variance Tradeoff & Cross-Validation for GATE DA: Formulas, Diagrams & Solved Problems
The evaluation theory that glues the whole ML syllabus together — the error decomposition, the U-curve, how every hyperparameter you know shifts the trade, and k-fold cross-validation worked on real numbers.
By Piyush Wairale · GATE DA Educator & Course Instructor, IIT Madras BS Programme · Updated August 2026
Key Takeaways
• Expected test error splits into three parts: bias² + variance + irreducible noise. Only the first two are under your control, and they pull in opposite directions.
• Underfitting = high train AND test error (high bias). Overfitting = low train, high test error (high variance). Diagnose from the two numbers alone.
• k-fold cross-validation trains k models, each on (k−1)/k of the data, validating on the held-out fold, then averages the k scores. LOOCV is the k = n extreme.
• Every hyperparameter you’ve met — tree depth, k in kNN, λ in ridge, C in SVM — is a dial on the same bias–variance axis. GATE asks the direction of the dial.
On this page
The error decomposition · Underfitting vs overfitting · The U-curve · Hyperparameter dials · Learning curves · Cross-validation (worked) · Choosing k & leakage · Solved problems · Mistakes · Exam patterns · FAQs
The Error Decomposition: Where Test Error Comes From
Fix a test point x and imagine retraining your model on many different random training sets. Each retraining gives a slightly different prediction f̂(x). The expected squared error against the true value decomposes as:
Bias is the systematic gap between the average prediction and the truth — the model family is too simple to capture the pattern. Variance is how much predictions wobble across training sets — the model is so flexible it memorises the accidents of each sample. Noise σ² is randomness in y itself; no model can remove it, which is why 100% test accuracy claims should make you suspicious. This decomposition is the single most connective idea in the GATE DA syllabus — it explains pruning, regularisation, k in kNN and C in SVM with one picture.
Underfitting vs Overfitting: Diagnose From Two Numbers
| Symptom | Underfitting (high bias) | Overfitting (high variance) |
|---|---|---|
| Training error | High | Very low (≈ 0) |
| Test error | High (≈ train) | Much higher than train |
| Typical cause | Model too simple, over-regularised | Model too flexible, too little data |
| Fix | More features, deeper model, lower λ | Regularise, prune, more data |
The U-Curve Every GATE Aspirant Must Be Able to Sketch
Training error only ever falls as complexity grows — a rich enough model can memorise anything. Test error falls while added complexity captures real signal, bottoms out at the sweet spot, then rises as the model starts fitting noise. Left of the minimum you are bias-dominated; right of it, variance-dominated. GATE questions describe a scenario and ask which zone you’re in — the two-error table above answers it mechanically.
▶ Watch: my complete Machine Learning playlist for GATE DA
Model evaluation and every ML topic, lecture by lecture — all playlists →
Every Hyperparameter Is the Same Dial
GATE never asks the decomposition in isolation — it asks how a specific knob moves you along the curve. The four that matter:
Tree depth (see decision trees): deeper → lower bias, higher variance. Pruning walks you back toward the sweet spot.
k in kNN: k = 1 memorises the training set (low bias, high variance); large k averages over many neighbours (high bias, low variance). Note the direction: increasing k increases bias.
λ in ridge (see the regression comparison): larger λ shrinks weights → bias up, variance down.
C in SVM (see the SVM guide): larger C punishes violations → bias down, variance up — the opposite direction to λ, because C multiplies the error term (C ≈ 1/λ).
Memorise those four directions as one sentence: depth↑ and C↑ move right on the U-curve; k↑ and λ↑ move left.
Learning Curves: What More Data Buys You
Plot error against training-set size instead of complexity. Training error rises with more data (harder to memorise), validation error falls, and the two converge. Read the gap: curves converging to a high plateau = high bias — more data won’t help, get a richer model. A large persistent gap between low train and high validation error = high variance — more data (or regularisation) will help. “Will collecting more data improve this model?” is a GATE scenario question answered entirely by which pattern you’re shown.
Cross-Validation: Estimating Test Error Honestly
A single train/test split (holdout) wastes data and gives a noisy estimate. k-fold cross-validation fixes both: partition the data into k equal folds; for each fold in turn, train on the other k−1 folds and validate on it; average the k scores.
Worked: 5-fold CV on 100 samples
Folds of 100/5 = 20 samples each. Each run trains on 80, validates on 20. Total model fits: 5. If the five validation accuracies are 0.85, 0.80, 0.90, 0.82, 0.88, the CV estimate is their mean: (0.85+0.80+0.90+0.82+0.88)/5 = 0.85. Every sample was validated on exactly once and trained on exactly 4 times.
LOOCV is k-fold with k = n: n fits of n−1 samples each — nearly unbiased but expensive (n = 1,000 means 1,000 trainings) and high-variance as an estimator. Stratified k-fold preserves class proportions inside every fold — essential for imbalanced data (a 95:5 dataset can otherwise produce folds with zero minority samples).
Choosing k, and the Data-Leakage Trap
Choosing k is itself a bias–variance decision. Small k (e.g. 2–3): each model trains on little data → pessimistic (biased) error estimates, but cheap. Large k (up to n): training sets are nearly full-size → low bias in the estimate, but expensive and the k estimates are highly correlated (variance). k = 5 or 10 is the standard compromise — the answer to “why 10-fold?” MCQs.
Data leakage: any preprocessing that looks at the whole dataset — scaling to global mean/variance, feature selection on all rows, imputation from global statistics — must be fitted inside each training fold only, then applied to that run’s validation fold. Preprocess-then-split lets validation information leak into training and inflates CV scores. “Standardised the full dataset before 10-fold CV — what’s wrong?” has appeared in GATE-adjacent papers; the answer is leakage, and the estimate is optimistically biased.
Three GATE-Style Problems, Solved
Problem 1 (MCQ). Model A: train error 2%, test error 18%. Model B: train error 15%, test error 16%. Diagnose each.
Solution. A has a huge train–test gap → overfitting (high variance): regularise, prune or add data. B has both errors high and close → underfitting (high bias): increase capacity or reduce regularisation. Note B actually has the better test error — “lower training error” never by itself means the better model.
Problem 2 (NAT). You tune 4 candidate values of λ using 5-fold CV, then retrain the winner on all data. How many model fits in total?
Solution. Each λ costs 5 fits → 4 × 5 = 20, plus 1 final refit = 21. (Full nested CV with an outer 5-fold loop would cost 5 × (4×5 + 1) = 105 — count carefully what the question includes.)
Problem 3 (MCQ). In kNN, k is increased from 1 to 25. What happens to bias and variance?
Solution. Bias increases, variance decreases. k = 1 fits every quirk of the sample; k = 25 averages over a broad neighbourhood, smoothing the boundary. Training error at k = 1 is 0 by construction — another reminder that training error is not a quality metric.
Common Mistakes to Avoid
Treating training error as the target. It’s a diagnostic. Model selection uses validation/CV error, final reporting uses a untouched test set.
Reversing the C direction. C behaves like 1/λ: large C = less regularisation = overfitting risk. Check against the SVM table before answering.
Forgetting irreducible noise. Bias² + variance alone understates expected error; the σ² term is why the U-curve’s minimum sits above zero.
Counting CV fits wrong. k-fold on m hyperparameter candidates = m×k fits (+1 refit if the question says so). Write the multiplication out.
Leaky preprocessing. Fit scalers, encoders and feature selectors on training folds only.
How GATE DA Asks This Topic
Recurring forms: (1) MCQ — diagnose over/underfitting from train/test numbers or a described learning curve; (2) MCQ — direction questions: what happens to bias/variance when depth, k, λ or C changes; (3) NAT — count folds, fold sizes or model fits; (4) MCQ — properties of LOOCV vs k-fold vs stratified, or spot the leakage. It’s the connective tissue of the ML section — revise it right after each classifier in the ML pillar roadmap.
Master the full ML syllabus for GATE DA 2027
My complete Machine Learning course covers bias–variance, cross-validation, regression, SVM, trees, clustering, neural networks and PCA with recorded lectures, notes and GATE-level practice — aligned exactly to the DA syllabus.
Explore the Machine Learning Course →FAQs: Bias–Variance & Cross-Validation for GATE DA
Do I need the full mathematical derivation of the decomposition?
No — GATE tests the three-term statement, what each term means, and directional reasoning. Knowing that E[(y−f̂)²] = bias² + variance + σ² and being able to classify scenarios is enough.
Why not always use LOOCV since it’s nearly unbiased?
Cost (n model fits) and estimator variance — the n models are trained on almost identical data, so their errors are highly correlated and the average wobbles. k = 5 or 10 balances bias, variance and compute.
Can more training data fix high bias?
No — learning curves that converge to a high plateau stay there. More data fixes variance problems; bias needs a richer model or weaker regularisation.
Is cross-validation used for anything besides error estimation?
Yes — hyperparameter tuning (pick the λ/C/depth with best CV score) and model selection between families. The final chosen model is then retrained on all training data.
What should I study next?
Clustering and PCA — the unsupervised half of the ML section. The ML pillar guide has the full order.
Connect the dots: see the dial in action with λ in ridge regression, C in SVM and pruning in decision trees, then track your coverage against the GATE DA 2027 syllabus. New ML problem-solving sessions drop regularly on my YouTube channel — subscribe so you don’t miss them.
Recent Post

A* search and alpha-beta pruning for GATE DA 2027: full open/closed-list trace, admissible heuristics, minimax with pruning counted leaf by leaf, solved problems.

Taylor series and maxima-minima for GATE DA 2027: standard expansions, e^0.1 and cos(0.2) approximated, derivative tests and the Hessian rule worked with solved problems.

Normal forms for GATE DA 2027: functional dependencies, attribute closure worked, 1NF to BCNF with full decompositions, checklist table and solved GATE problems.

SQL and relational algebra for GATE DA 2027: σ, π and joins worked on sample tables, GROUP BY and nested queries evaluated row by row, plus solved GATE problems.

BFS and DFS for GATE DA 2027: graph traversals traced step by step with queue and stack states, shortest paths, Python code, complexity and solved GATE problems.

Sorting algorithms in Python for GATE DA 2027: bubble, insertion, selection, merge and quick sort traced step by step, binary search, complexity table and solved problems.
Learn Daily, Wherever You Are
Free lectures, exam updates, PYQ discussions, and job alerts — delivered through our YouTube channel and Telegram communities.


