Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

1. Evaluating ML Algorithms & Model Selection

Lesson 2 of 22 in the free Machine Learning II notes on Siksha Sarovar, written by Rohit Jangra.

1. Evaluating ML Algorithms and Model Selection

Model evaluation is the foundation of trustworthy ML. Without rigorous evaluation, we cannot distinguish genuine generalization from overfitting — a model that memorizes training data but fails in production.

Bias-Variance Decomposition

The generalization error decomposes as: Total Error = Bias^2 + Variance + Irreducible Noise

  • Bias: Error from incorrect assumptions. High bias implies underfitting — the model is too simple.
  • Variance: Error from sensitivity to training data. High variance implies overfitting — the model is too complex.
  • Sweet spot: Complexity that minimizes bias^2 + variance simultaneously.

Cross-Validation Techniques

MethodHow It WorksWhen to Use
HoldoutSingle 80/20 splitLarge datasets, quick checks
k-Fold CVk rotated validation splitsStandard practice
Stratified k-FoldPreserves class proportionsImbalanced classes
LOOCVn-Fold, leave one outVery small datasets
Time-Series CVForward walk-through splitsSequential/temporal data

Classification Metrics

MetricFormulaPrefer When
Accuracy(TP+TN)/TotalBalanced classes
PrecisionTP/(TP+FP)False positives costly
RecallTP/(TP+FN)False negatives costly
F1-Score2PR/(P+R)Imbalanced datasets
AUC-ROCArea under ROCThreshold-independent

Model Selection Strategies

  1. Grid Search: Exhaustive sweep over hyperparameter grid.
  2. Random Search: Sample from distributions — often 3x more efficient for large grids.
  3. Bayesian Optimization: Build a surrogate model to focus on promising hyperparameter regions.

Common Pitfalls

  • Data leakage: Preprocessing using future information contaminates results.
  • Test set reuse: Multiple comparisons inflate apparent performance.
  • Wrong metric: Accuracy is misleading on highly imbalanced datasets.

Exam-Ready Summary

  • 5-fold or 10-fold CV is standard; LOOCV is unbiased but expensive
  • Always stratify folds for classification tasks
  • High bias: increase model complexity or add features
  • High variance: add data, apply regularization, reduce model complexity
  • Data leakage is the most dangerous source of misleading evaluation results