AI Advanced · Classical ML & Data Science

Classical ML & Data Science

Long before chatbots, machine learning was quietly running the world — spam filters, credit scoring, fraud detection, demand forecasting, recommendation engines. That whole field, the one that learns patterns from tables of numbers rather than paragraphs of text, is “classical” ML, and it still powers most of the prediction happening in production today. This page is your orientation: what it is, how it thinks, and when a boring little model on a spreadsheet beats the smartest LLM you can buy.

☺ Explain it like I’m 10

An LLM is a friend who read the whole internet and is amazing at words. Classical ML is a different friend who is a whiz with spreadsheets — give them a table of numbers about houses, and they’ll spot the pattern and guess a new house’s price. You don’t need the word-genius for that job; the number-whiz is faster, cheaper, and can show you exactly how they guessed.

🐿️Your host for this topic: Nutty the Squirrel — Nutty lives in data, and classical ML is all about learning patterns from tables of it.

What “classical” ML is — and why it still runs the show

☺ Like you’re 10: The flashy new robot that writes poems isn’t the only robot in town. The quiet older robots that sort your mail, catch cheaters, and guess tomorrow’s weather have been on the job for years — and they’re still the ones doing most of the real work.

When people say “AI” today they usually mean large language models. But machine learning — teaching a computer to find patterns in data instead of hand-coding rules — is a much older and broader field. “Classical ML” is the umbrella term for everything that isn’t a giant deep neural network trained on text or images: the algorithms that learn from structured, tabular data — rows and columns, like a spreadsheet or a database table.

It’s tempting to think LLMs made this obsolete. They didn’t. The overwhelming majority of ML actually deployed in businesses is still classical, and for good reasons you’ll see throughout this page — it’s fast, cheap, explainable, and phenomenally good at the tabular-prediction problems that make up most of real-world “AI.” Some of the biggest jobs it quietly does:

These are adjacent to the LLM world you already know from the rest of this course, and they connect to it more than you’d expect — modern AI systems routinely mix classical models with LLMs (more on that at the end). Think of this page as a solid map, not a from-scratch course: enough to know how the field thinks, when to reach for it, and where to go deeper.

“AI” in the headlines means LLMs. “ML” in production still mostly means classical models on tabular data — and that’s not a legacy footnote, it’s the working majority.

Supervised vs unsupervised: the two big families

☺ Like you’re 10: Two ways to learn. In the first, a teacher shows you flashcards with the answers on the back until you can guess new ones — that’s supervised. In the second, you get a pile of toys with no labels and you sort them into groups yourself by which ones seem alike — that’s unsupervised.

Almost all classical ML splits into two families, and the difference is simply: did your data come with the answers, or not?

Supervised learning is learning from labeled examples. You have historical data where you already know the outcome — houses with their sold prices, emails marked spam or not — and you train a model to predict that outcome for new, unseen cases. It splits again by what you’re predicting:

Unsupervised learning works on data with no labels — no “right answer” to predict. Instead of learning a target, it finds structure hiding in the data itself:

FamilyDataGoalEveryday example
Supervised · regressionLabeled, numeric targetPredict a numberEstimate a house’s price from its features
Supervised · classificationLabeled, category targetPredict a categoryFlag a transaction as fraud / not fraud
Unsupervised · clusteringUnlabeledGroup similar thingsDiscover customer segments
Unsupervised · dim. reductionUnlabeledCompress featuresSquash 200 columns to 2 for a scatter plot

There’s a third family worth naming so the map is complete: reinforcement learning, where an agent learns by trial and error from rewards rather than from a fixed dataset — that gets its own page. And the deep-learning world (deep learning, computer vision & NLP) is really supervised/unsupervised learning too, just with much bigger, layered models on images and text.

The data-science workflow: the loop every project runs

☺ Like you’re 10: Baking a cake has steps in order — gather ingredients, measure them out, bake, taste-test, then serve. Building a model has the same kind of recipe, and skipping the taste-test (checking it actually works) is how you serve something nobody can eat.

A machine-learning project isn’t “pick an algorithm.” The algorithm is a small part; most of the work is around it. Nearly every project follows the same loop, and the first stages eat most of the time:

Data collect · clean Features shape inputs Train fit the model Evaluate test honestly Deploy & monitor not good enough? iterate on features & model
  1. Data. Collect it, then clean it — fix missing values, remove duplicates, fix bad rows. This unglamorous step is famously ~70–80% of the real work. Bad data quietly ruins everything downstream.
  2. Features. Turn raw data into the numeric inputs a model can learn from (its own section below). This is where domain knowledge lives.
  3. Train. Pick an algorithm and let it fit the patterns in your training data — adjusting its internal parameters to make good predictions on the examples it sees.
  4. Evaluate. Measure how well it does on data it never trained on. This is the honesty check, and it’s where most beginners go wrong (its own section, too).
  5. Deploy & monitor. Ship the model so real requests hit it, and watch it over time — because the world drifts and yesterday’s model slowly goes stale.

The loop is a loop for a reason: evaluation usually sends you back to try better features or a different model. And the “deploy & monitor” tail is a whole discipline of its own — the same operational muscle you’ll need for LLM apps lives in MLOps and the broader Production & Ops lesson, while getting clean data in the first place is data engineering.

A tour of the workhorse algorithms

☺ Like you’re 10: These are different “thinking styles” for spotting patterns. One draws a straight line through dots. One plays twenty-questions. One asks a whole crowd of question-askers to vote. You don’t need the math — just the vibe of each, and roughly when it’s the right pick.

You don’t need to derive the math to be dangerous here — you need intuition for what each algorithm does and when it fits. Here are the ones you’ll meet again and again:

AlgorithmTypeOne-line intuitionReach for it when…
Linear regressionRegressionBest straight line through the dotsYou want a fast, explainable numeric baseline
Logistic regressionClassificationStraight line, but outputs a probabilitySimple yes/no with a need to see the reasoning
Decision treeBothA flowchart of yes/no questionsYou need a human-readable single model
Random forestBothA crowd of trees votesStrong, low-effort default on tabular data
Gradient boostingBothTrees that fix each other’s mistakesYou want top accuracy on tabular data
k-meansClusteringGroup points around k centersFinding segments with no labels
SVMClassificationWidest-margin dividing lineSmall, clean datasets
◆ Rule of thumb

On tabular data, start boring: a logistic/linear regression as a baseline, then a gradient-boosted tree (XGBoost/LightGBM) as your strong contender. Neural nets rarely beat boosting on spreadsheets — save the deep learning for images, audio, and text.

Features & feature engineering: where projects are won

☺ Like you’re 10: A model can only look at numbers. So if you want it to understand “this happened on a weekend” or “this house is near a school,” you have to turn those ideas into numbers first. Picking and preparing those clues is often what makes one model way smarter than another.

A feature is just one input column the model learns from — square footage, day of week, number of past purchases. Feature engineering is the craft of turning raw data into features that actually help the model, and it’s frequently the difference between a mediocre model and a great one. The algorithm gets the glory; the features do the work. Common moves:

This is the closest classical-ML analog to prompting in the LLM world: in both, most of your leverage is in how you present the input, not in the underlying model. And it echoes a theme from across this course — good inputs beat clever models. There’s even a bridge between the two worlds: text and images can be turned into embeddings (dense numeric vectors from a neural network) and then fed as features into a classical model. That’s a common, powerful pattern — let a deep model do the “understanding” and a boosted tree do the fast, cheap prediction.

Evaluation & the overfitting trap

☺ Like you’re 10: If a student memorizes the exact answers to the practice test, they’ll ace the practice test and flunk the real exam. To know if they actually learned, you have to test them on questions they’ve never seen. Models cheat the same way — so you always hide some data and test on that.

Here’s the single most important idea in all of applied ML, and the one beginners most often get wrong. A model’s score on the data it trained on is meaningless — it can just memorize. What matters is how it does on data it has never seen. That’s the whole reason for a train/test split: before training, you hide a slice of your data (say 20%), train on the rest, and then measure the model only on the hidden slice.

Overfitting is when a model learns the training data too well — memorizing its noise and quirks instead of the real pattern — so it looks brilliant on training data and falls apart on new data. A model that scores 99% on training but 70% on the test set isn’t smart; it’s memorizing. The cure is measuring honestly (train/test split, or the sturdier cross-validation where you rotate which slice is held out) and keeping the model simple enough to generalize.

Once you’re measuring on held-out data, you need the right ruler — and “accuracy” alone is a famous trap:

MetricForWhat it tells youGotcha
AccuracyClassification% of predictions that were correctUseless on rare events — see below
PrecisionClassificationOf the things you flagged, what fraction were rightHigh precision can hide missed cases
RecallClassificationOf the real positives, what fraction you caughtEasy to “catch all” by flagging everything
RMSE / MAERegressionHow far off your numeric predictions are, on averageRMSE punishes big misses more than small ones

Why accuracy lies: imagine fraud is 1 in 1,000 transactions. A lazy model that predicts “never fraud” is 99.9% accurate — and completely worthless, because it catches zero fraud. That’s why fraud, disease, and other rare-event problems live and die by precision and recall instead. There’s usually a tradeoff: catch more real fraud (higher recall) and you’ll also flag more innocent charges (lower precision). Which you tune toward depends on the cost of each mistake — a missed cancer diagnosis and a false fraud alert are not equally bad.

⚠ The number-one beginner mistake

Never judge a model on the data it trained on, and never trust bare “accuracy” on imbalanced problems. A model that looks perfect in training and stellar by accuracy is often overfit, useless, or both. Hold out a test set, pick a metric that matches the real cost of being wrong, and let the held-out score be the truth.

🎬 At the AI Academy
🐿️

Nutty the Squirrel: Right, I’ve got a spreadsheet of 10,000 past home sales — square footage, bedrooms, zip code, sale price. I want to predict the price of a new listing.

🦊

Foxy: Easy — why not just ask a chatbot? Paste the house in and let the LLM guess the price.

🦉

Professor Owl: Because this is a tabular problem, Foxy. A gradient-boosted tree trained on those 10,000 rows will be more accurate, cost a fraction of a cent per prediction, run in milliseconds, and — crucially — show you which features drove each estimate. The LLM would just eyeball it.

🐢

Timmy the Turtle: And before anyone celebrates that accuracy — hold out 2,000 of those sales. Train on 8,000, test on the 2,000 the model never saw. If it only shines on the rows it already memorized, it hasn’t learned a thing.

🐿️

Nutty the Squirrel: Deal. Boosted tree, train/test split, and I’ll report the error on the held-out set — not the training score. Honest numbers only.

When classical ML beats an LLM — and how they team up

☺ Like you’re 10: Use the right tool for the job. You wouldn’t hire a world-famous novelist to add up your grocery bill — a $2 calculator is faster, cheaper, and you can check its work. For number-and-table jobs, the little model is the calculator.

The LLMs you’ve studied are extraordinary at language, reasoning, and open-ended tasks. But for a huge class of problems, a classical model is simply the better engineering choice. Reach for classical ML when you have:

And it’s not either/or — the most interesting modern systems combine them. A few patterns you’ll see:

Knowing both toolkits — and when to switch between them — is what separates someone who “uses AI” from someone who builds with it well. If you want to go deeper on the internals, the sibling pages branch out from here: the neural-network foundations in deep learning and training models, the perception fields in computer vision & NLP, learning-from-rewards in reinforcement learning, and the operational side in MLOps and data engineering. The further reading page points to full courses if you want to actually build these models yourself.

🦫 Benny’s workshop · 10 min

Grab any small public tabular dataset (a classic is the “Titanic survivors” or a housing-prices CSV). In a notebook, split it into train/test, fit a LogisticRegression or RandomForestClassifier from scikit-learn, and print both the training accuracy and the test accuracy. Watch the gap between them — that gap is overfitting, made visible in about fifteen lines of code.

🐢 Timmy’s checkpoint

(1) What’s the difference between supervised and unsupervised learning, and how do regression and classification split supervised further? (2) Why is a model’s score on its own training data not to be trusted — and what does a train/test split fix? (3) A fraud model is “99.9% accurate.” Why might that number be worthless, and what should you look at instead? (4) Name two reasons you’d pick a gradient-boosted tree over an LLM for predicting house prices.

Check your answers
  1. Supervised vs unsupervised, and the two sub-types: Supervised learning trains on labeled examples where you already know the outcome (houses with their sold prices, emails marked spam), while unsupervised learning works on unlabeled data and finds hidden structure instead of predicting a target. Supervised splits further by what you predict: regression outputs a continuous number (a house price, tomorrow’s temperature), and classification outputs a category or label (spam or not, fraud or legit), often with a probability attached.
  2. Why training-data scores lie, and what a split fixes: A model’s score on the data it trained on is meaningless because it can simply memorize that data — a model can score 99% on training yet only 70% on new data (overfitting). A train/test split fixes this by hiding a slice (say 20%) before training and measuring the model only on that never-seen data, giving an honest read on how it will generalize.
  3. Why 99.9% accuracy can be worthless, and what to look at: If fraud is only 1 in 1,000 transactions, a lazy model that always predicts “never fraud” is 99.9% accurate yet catches zero fraud, so accuracy hides total failure on the rare event that matters. For imbalanced rare-event problems you should look at precision and recall instead, tuning the tradeoff between them based on the real cost of a missed case versus a false alarm.
  4. Two reasons for a gradient-boosted tree over an LLM here: House-price prediction is a tabular problem, which is classical ML’s home turf where a boosted tree trained on the rows is more accurate. It also costs a tiny fraction of a cent per prediction and runs in milliseconds (versus a slow, pricier LLM call), and it exposes which features drove each estimate, giving interpretability the LLM can’t — any two of these justify the choice.