ML model evaluation mistakes that make good numbers meaningless
Nine errors behind great offline metrics and bad production models: random splits on time series, threshold-free metrics, tuning on the test set.

Writer
@vaibhavkothari · Greater Noida
Full-stack engineer · writing beginner-friendly Python, OpenCV & ML guides on Sythra
Chai enthusiast, code sorcerer, and game aficionado. I build products at the intersection of performance, developer experience, and real-world impact — and I write the Sythra Articles guides you’d want when you’re starting out (Python, OpenCV, MediaPipe, talking to LLMs, and more). Open to interesting collaborations. Let’s connect.
Published
Nine errors behind great offline metrics and bad production models: random splits on time series, threshold-free metrics, tuning on the test set.
Splitting correctly stops the obvious leak. Target encoding, feature stores, label windows and proxy features leak anyway — how to find each.
The model is the small part. Training-serving skew, feature freshness, shadow deploys, drift detection, and monitoring that catches decay.
The geometry of embedding space: why you normalise, what dimensionality really buys you, and the anisotropy problem nobody mentions.
Queries, keys and values with real numbers. Why the scaling factor is sqrt(d_k), what multi-head attention buys, and how causal masking works.
A working decoder-only transformer in 120 lines. Pre-norm, residual streams, why the MLP is 4x wide, weight tying, stable initialisation.
Convolution forward and backward with no framework. The im2col trick that makes it fast, why the backward pass is a convolution too, and a net that trains.
An agent is a loop with tools and a stopping condition. Context growth, error handling, termination — and when to write a chain instead.
Tool calling fails at the interface, not the model. Schema design, descriptions, error contracts, and what MCP actually standardises.
Vibes do not scale and BLEU measures nothing you care about. Eval sets, LLM-as-judge without fooling yourself, and the biases that corrupt it.
Most RAG fails at retrieval, not generation. Build a golden set, measure recall@k, run chunking experiments, add a reranker when data says so.
Fine-tuning teaches behaviour, RAG supplies facts. A decision framework, the LoRA maths, real costs, and the cheaper ladder to climb first.
ANN search trades accuracy for speed. How HNSW graphs and IVF-PQ quantisation work, which knobs move recall, and how to choose an index.
Why A @ B and A * B give completely different answers, what "shapes not aligned" really means, and the one rule that makes matrix shapes click for good.
Your dataset is a matrix, a model is a matrix, and training is matrix multiplication repeated. Six operations, drawn out, with the ML job each one does.
Retrieval-augmented generation in plain Python: split a PDF into chunks, find the relevant ones, and let Claude answer using only those. No vector database required.
Asking a model to reply in JSON works until it does not. Learn why tool schemas beat prompt begging, and how to validate every response before it reaches your code.
Three ways to keep project dependencies apart. A straight comparison of speed, package coverage and complexity, plus a clear recommendation for each situation.
Free GPUs, offline work, real debugging — each tool wins somewhere. An honest comparison plus the setup that gets you the benefits of all three.
A script that sorts files into folders by type, handles name clashes safely, and can keep watching for new arrivals. Dry-run first, so nothing is ever lost.
No maths degree required. Load data, split it, fit a model, check the score — the four steps every scikit-learn project uses, explained line by line.
A 99% accurate model that fails in production usually has data leakage. Learn the four ways test data sneaks into training and how a scikit-learn Pipeline prevents all of them.
Accuracy hides the mistakes that matter. Learn to read a confusion matrix, tell precision from recall, and pick the metric that fits what your model is actually for.
Overfitting means your model memorised the training data instead of learning from it. Here are the three checks that reveal it and the fixes that work, in order.
Ten pandas fixes for the problems every real dataset has: broken headers, duplicate rows, mixed types, silly outliers and inconsistent categories.
Build a gesture volume controller with OpenCV and MediaPipe. Pinch your thumb and index finger together to turn the sound down, spread them apart to turn it up.
Two ways to detect faces in a webcam feed with Python. See the code for both, then a straight comparison of speed, accuracy and when each one is the right choice.
Hold up three fingers and Python says three. Learn the landmark logic behind finger counting, including the thumb rule that trips everyone up.
Use MediaPipe Pose to measure your elbow angle and count push-up reps automatically. The same state machine works for squats, curls and any repeated movement.
Tesseract plus a few lines of OpenCV preprocessing turns blurry photos into clean text. Learn the cleanup steps that take accuracy from unusable to reliable.
Python cannot find OpenCV because the package was installed into a different Python than the one running your script. Here is how to find the right Python and fix it in under five minutes.
Windows says pip is not recognized as an internal or external command because pip is not on your PATH. Use python -m pip for an instant fix, then repair PATH properly.
Python uses spaces to decide which lines belong together, so indentation is part of the grammar. Here is how to read each IndentationError message and fix it fast.
This error means a function handed you None and you tried to index it. Learn the three functions that return None most often and the two-line guard that fixes them.
This error means one cell in your data is not a number. Learn how to find the exact bad row in pandas and clean commas, currency symbols, percent signs and blanks for good.
Learn how to build a virtual mouse in Python using OpenCV and MediaPipe hand tracking. Move the cursor with your index finger and click with a pinch — beginner-friendly step-by-step tutorial.
The easiest possible start: install nothing fancy, type a few lines, and see Python talk back to you.
A beginner-friendly Python script that renames messy files in a folder — with a safe dry-run mode so nothing breaks.
BeginnerSend a prompt to an AI model from Python and print the reply — a short, beginner-friendly walkthrough with almost no setup drama.
You don’t need every Python trick. Master these seven patterns and you’ll read — and write — almost any beginner ML notebook with confidence.
BeginnerSythra is a machine learning education platform — structured courses, an AI tutor that teaches, in-browser labs, and Project Studio so you learn ML by building.