Braj Kishore
JourneyVaultML FoundationsAI PM GuideAgenticNewsWork With MeMentorshipPulseNow
Say hi

Hiring · Building · Investing

Have a system — or a team —that needs to scale?

info@avyxon.ai

Usually replies within a day · track record here

JourneyVaultML FoundationsAI PM GuideAgenticNewsWork With MeMentorshipPulseNow
LinkedInXYouTubeSubstackInstagramThreadsFacebookDiscordGitHubTopmate
© 2026 Braj Kishore · Bengaluru, INThink Big · Start Small · Scale Fast
ML Foundations
02Track 1 · Rules → Learning

Framing a learning problem

Supervised, unsupervised, self-supervised and reinforcement — plus the data split discipline that decides whether your numbers mean anything.

50 min2 interactives5 sources

The most common way to get 99% accuracy on your first attempt is to have leaked the answer into the features. Every experienced ML engineer has done it; the good ones have a checklist so they catch it before the demo.

The intuition

Think of the test set as a sealed exam paper. Every time you look at it to decide something — a hyperparameter, a feature, an architecture — you've let the exam leak into the revision, and the score stops predicting anything about the real world.

Unlearn this

That self-supervised learning is a third exotic category. It's supervised learning where the labels are manufactured from the data itself — hide a word, predict it. That trick is the entire reason LLMs could be trained on the internet: the labelling cost went to zero.

01The four paradigms, and what each one costs

Supervised learning learns a mapping from inputs to known outputs. You need labelled pairs, and someone has to produce them. This is the workhorse: classification and regression, fraud, churn, pricing, ranking, diagnosis. The cost is labelling, and it is always underestimated.

Unsupervised learning finds structure without labels — clustering, dimensionality reduction, anomaly detection. It's cheap on data and expensive on interpretation: nothing tells you whether the four clusters you found mean anything, so it usually ends as an input to a human decision rather than an automated one.

Self-supervised learning invents the labels from the data's own structure. Mask a token and predict it; predict the next frame; match an image to its caption. The label is free, so the training set is 'everything we could download'. This is the paradigm behind every LLM and every modern vision-language model, and it is why the last decade's progress was so lopsided towards text and images — those are the modalities where free labels are abundant.

Reinforcement learning learns from a reward signal received after acting, not from labelled answers. It fits sequential decisions with delayed consequences — games, robotics, and post-training alignment of LLMs via RLHF. It's sample-hungry, unstable to train, and needs an environment you can simulate cheaply or a lot of patience.

Try it

Which paradigm is this?

Ten real problems. Get the paradigm right, then read what it costs you on a roadmap.

02Features, labels and the row/column mental model

Almost every supervised problem reduces to a table. Each row is an example, each column a feature, and one designated column is the label — the thing you want to predict. Getting fluent at drawing that table for any problem someone describes is the fastest way to sound senior in a screening interview.

Classical ML lives or dies by feature engineering: you hand-craft the columns that carry signal — day of week, rolling seven-day average, ratio of this to that. Deep learning's central claim is representation learning — that given enough data, the network will discover better features than you'd have designed, which is exactly what convolutional filters do for images.

The 2026 honest position: for images, audio, text and video, learned representations won outright. For medium-sized tabular data, gradient-boosted trees plus good hand-built features are still frequently the strongest baseline, and pretending otherwise costs you months.

The point

'Garbage in, garbage out' is not a cliché in ML, it's an arithmetic fact: the model can only recover the signal that survives in your features. Time spent on data quality has a better return than time spent on architecture, at almost every stage.

03Train, validation, test — and why the test set is touched once

Split the data three ways. Train fits the parameters. Validation chooses the hyperparameters and tells you when to stop. Test is opened once, at the end, to estimate performance on data the whole process has never seen.

The reason for three and not two is subtle and often asked: every decision you make by looking at a set fits information from that set into your model, even if no gradient touched it. Choosing the learning rate that maximises validation accuracy overfits the validation set. That's tolerable, because the test set is still clean — as long as you don't then go back and 'just check' the test set and tune again.

Randomly shuffling before splitting is the default, and it is wrong for time series and for grouped data. For anything with a temporal element, split by time: train on the past, validate on the future, exactly as production will run. For data with groups — several rows per patient, per user, per merchant — split by group, or the same entity appears on both sides and your score is fiction.

train 60–80% · validation 10–20% · test 10–20%

Typical for small and medium datasets; with millions of rows a 98/1/1 split leaves plenty in each holdout.

04Leakage: the bug that makes you look brilliant

Data leakage is any situation where information that wouldn't be available at prediction time makes it into training. It produces spectacular offline metrics and a model that collapses in production. Three flavours cover most incidents.

Target leakage — a feature that is a consequence of the label rather than a cause. The classic is including `account_closed_date` when predicting churn, or including a `fraud_investigation_opened` flag when predicting fraud. The model learns the paperwork, not the phenomenon.

Temporal leakage — computing a feature using data from after the prediction moment. A 30-day rolling average that includes the following week; a customer lifetime value that already reflects the purchase you're trying to predict.

Preprocessing leakage — fitting scalers, imputers, encoders or feature selectors on the full dataset before splitting. Your normalisation now encodes the test set's mean. The fix is a pipeline that fits on train and only transforms validation and test.

The leakage-safe shape: fit on train only, transform everything else.
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import TimeSeriesSplit, cross_val_score

# Everything that LEARNS from data lives inside the pipeline, so it is
# re-fitted on the training fold alone at every split. Scaling outside
# the pipeline is the single most common leak in real notebooks.
pipe = Pipeline([
    ("scale", StandardScaler()),
    ("clf", LogisticRegression(max_iter=1000)),
])

# Time-ordered data gets time-ordered folds: always train on the past.
scores = cross_val_score(pipe, X, y, cv=TimeSeriesSplit(n_splits=5), scoring="average_precision")
print(scores.mean(), scores.std())

In an interview

"Your first model scores 0.99 AUC. What do you do?" — Correct answer: assume leakage and go looking for it. List the three kinds, then say you'd check feature importances for a suspiciously dominant feature and re-split by time or by group.

Cross-validation and the right way to build a pipelinescikit-learnData Leakage in Machine LearningKaggle / competition write-ups

Try it

The bug that makes you look brilliant

Nine features, three of which leak. Watch the offline and production numbers separate.

05Cross-validation, and the assumption production breaks

k-fold cross-validation rotates the validation set through k slices and averages the score, which buys you a much more stable estimate and a standard deviation you can quote. It costs k times the training compute, so it's standard for small and medium datasets and rare for large deep-learning runs, where a single fixed holdout is the norm.

Use stratified folds for imbalanced classification so every fold keeps the class ratio. Use grouped folds when rows share an entity. Use forward-chaining folds for time series. Choosing the wrong fold strategy is a quiet, expensive mistake that no error message will catch.

Underneath all of it sits one assumption: that training and future data are drawn from the same distribution — independent and identically distributed. Production violates this continuously. User behaviour shifts, competitors change, a pandemic arrives, and your model's inputs no longer look like its training set. That's drift, and it's why a deployed model is a system with an operations burden, not an artefact you finish.

Machine Learning Fundamentals: Cross ValidationStatQuest with Josh Starmer
The vocabulary, defined once
Supervised learning
Learns input → output from labelled pairs. The workhorse; labelling is the cost.
Self-supervised learning
Labels manufactured from the data itself (mask a token, predict it). Free labels — the reason LLM pretraining scales.
Reinforcement learning
Learns from delayed reward after acting. Games, robotics, and RLHF for aligning LLMs.
Data leakage
Information unavailable at prediction time reaching training. Produces great offline numbers and production collapse.
Stratified / grouped / time-series split
Fold strategies that preserve class balance, keep an entity on one side, or always train on the past.
Distribution shift (drift)
Live data drifting away from training data, breaking the i.i.d. assumption. Why monitoring is not optional.

The lab

Everything above, with the dials exposed. Break it deliberately — the failure modes are where the understanding is.

Try it

Which paradigm is this?

Ten real problems. Get the paradigm right, then read what it costs you on a roadmap.

Try it

The bug that makes you look brilliant

Nine features, three of which leak. Watch the offline and production numbers separate.

What they actually ask

Framing a learning problem — the interview questions

QWhat is data leakage and how do you detect it?Answer it out loud first, then open this

Any information in training that wouldn't exist at prediction time. Detection: implausibly high scores, a single feature dominating importance, a large gap between offline and online metrics. Prevention: build every fitted transform into a pipeline, split by time or group, and for each feature ask 'would I know this value at the moment I have to predict?'

What they're listening for
Naming target, temporal and preprocessing leakage as distinct categories reads as experience rather than reading.

QYou have 500 labelled examples and a million unlabelled ones. What do you do?Answer it out loud first, then open this

Start with the pre-trained model — self-supervised representations already learned from the large corpus, then fine-tune or few-shot on the 500. Otherwise: semi-supervised approaches, active learning to spend the labelling budget on the examples nearest the decision boundary, and heavy cross-validation because a single holdout of 500 gives a hopelessly wide confidence interval.

QHow would you split data for a fraud model?Answer it out loud first, then open this

By time, forward-chaining — fraud patterns are adversarial and non-stationary, so a random split trains on the future and flatters the model. I'd also group by account so the same fraudster can't appear on both sides, and stratify to keep the (very low) positive rate representative in each fold.

Before you move on

Recall beats re-reading, every time. Answer before you flip.

Framing a learning problem · self-test1 / 3

Why three splits rather than two?

Go to the primary sources

Where each claim above comes from. Open them alongside the lesson rather than after it — the papers are shorter than you think, and the figures usually carry the whole argument.

Watch
  • Machine Learning Fundamentals: Cross ValidationStatQuest with Josh StarmerSix minutes that make k-fold obvious, including why you rotate the validation slice rather than picking one.
Read
  • Data Leakage in Machine LearningKaggle / competition write-upsWorked examples of target and train-test contamination leakage from people who lost competitions to it.
Docs
  • Cross-validation and the right way to build a pipelinescikit-learnThe canonical documentation of why every fitted transform belongs inside the pipeline — with the leakage failure spelled out.
Course
  • Machine Learning Crash CourseGoogle for DevelopersFree, interactive, and the fastest route from 'I've read about it' to 'I've moved the sliders'. Do the framing and generalisation units alongside this lesson.
Book
  • Introduction to Machine Learning InterviewsChip HuyenFree online book. The chapters on ML fundamentals and on framing problems map almost exactly onto this track.

External links open in a new tab. Every URL was reachable when this page was written; links rot, so treat the list as a map rather than a guarantee.

Got it? Tick it off — progress saves on this device.

← PreviousFrom rules to learningNext →One neuron
Which paradigm is this?10 problems

Problem 1 of 10

Predict whether a transaction is fraudulent, from 200,000 historical transactions marked fraud / not fraud by the chargeback team.

The answer matters less than the follow-up: what does this paradigm cost you? Labels are a line item, reward signals need an environment, and 'unsupervised' usually means a human still has to interpret the output.

Churn model — pick your features
0.500.751.00offlineproduction

Offline AUC

0.860

what your notebook reports

Production AUC

0.860

what users actually get

No leaks. Offline 0.860 and production 0.860 agree, which is the only state in which your offline number is worth quoting. It's a lower number than the leaky version — and it's the real one. Now try adding cancellation_reason_code.

For every feature, ask one question: would I know this value at the exact moment I have to make the prediction? Three of these nine fail it, and all three make the offline number better.

Which paradigm is this?10 problems

Problem 1 of 10

Predict whether a transaction is fraudulent, from 200,000 historical transactions marked fraud / not fraud by the chargeback team.

The answer matters less than the follow-up: what does this paradigm cost you? Labels are a line item, reward signals need an environment, and 'unsupervised' usually means a human still has to interpret the output.

Churn model — pick your features
0.500.751.00offlineproduction

Offline AUC

0.860

what your notebook reports

Production AUC

0.860

what users actually get

No leaks. Offline 0.860 and production 0.860 agree, which is the only state in which your offline number is worth quoting. It's a lower number than the leaky version — and it's the real one. Now try adding cancellation_reason_code.

For every feature, ask one question: would I know this value at the exact moment I have to make the prediction? Three of these nine fail it, and all three make the offline number better.