
Classical Anomaly Detection: Find Unusual Data Without Labels
Anomaly detection is not "find the weird rows." It is a decision about what counts as normal, made before you ever run an algorithm. Get that decision…
Read tutorialArticles whose authoritative article variant is intuition and whose primary outcome is conceptual understanding, mechanism, or practical interpretation.
Tagged articles
92 articles in this tag.

Anomaly detection is not "find the weird rows." It is a decision about what counts as normal, made before you ever run an algorithm. Get that decision…
Read tutorial
If you already understand decision trees, you know the dilemma: a deep tree memorizes the training data and fails on new data, while a shallow tree is too…
Read tutorial
You trained a model. You saved it. Now a new file of rows arrives, and each one needs a prediction. This is where a saved model proves its worth—or quietly…
Read tutorial
Two models can post nearly identical test scores and still fail for opposite reasons. One misses because it never learned the pattern. The other misses…
Read tutorial
Your model scores 0.82 accuracy on the test set. That feels like a fact—something solid you can report and defend. Run the experiment again on a different…
Read tutorial
The real question is not whether a column contains text or numbers. It is whether the model should treat those values as ordered quantities or as separate…
Read tutorial
You've seen the demos. A neural network identifies objects in photos, translates speech in real time, and writes fluent text. Meanwhile, someone keeps…
Read tutorial
Your spam filter just flagged an email with a score of 0.55. Is it spam? The model isn't telling you—it's asking you to decide. Somewhere between the…
Read tutorial
Clustering always returns groups. Even on random noise, even on data with no structure worth naming, every algorithm will happily partition your points and…
Read tutorial
K-means does not discover the real categories hiding in your data. It draws geometric boundaries around points that happen to sit close together. Those…
Read tutorial
Every clustering algorithm will happily partition pure noise into tidy groups. Run k-means on random data, and it returns clean circles of assigned points.…
Read tutorial
One dataset, many feature types, one honest workflow. That is the problem ColumnTransformer solves.
Read tutorial
You split your data once. Your model scores 0.91. You re-run the same split with a different random seed, and suddenly it scores 0.84. Same model. Same…
Read tutorial
You add more columns to your dataset expecting a better model. Instead, your k-nearest neighbors accuracy drops, your clusters turn to mush, and every…
Read tutorial
Your model aced the test set. Clean evaluation, strong metrics, confident you. Then you deploy it, and the real world quietly moves on without telling you.
Read tutorial
You train a model. The validation score comes back at 0.98. You feel like a genius. Then the model goes into the real world and performs like a coin flip.
Read tutorial
You learned K-means, and it felt clean: pick a number of groups, let centroids pull points inward, and read off the labels. Then you hit a dataset with…
Read tutorial
Your decision tree scores 98% on training data. On new data, it drops to 74%. The tree didn't fail because it wasn't smart enough. It failed because it was…
Read tutorial
A decision tree is not a rulebook the model memorizes. It is a partitioning machine: a greedy process that keeps cutting your data into smaller, cleaner…
Read tutorial
You improved the model twice. The validation score went up, then up again. Now every change you try makes it worse or does nothing. You are not out of…
Read tutorial
You've tried different algorithms. You've tuned parameters until your eyes glaze over. And still, your model's score sits at a plateau, stubbornly refusing…
Read tutorial
You have a list of sentences, a folder of images, or a pile of Python dictionaries. You call .fit() on your model, and it refuses. The error message is not…
Read tutorial
Feature hashing trades a little information and a lot of interpretability for something genuinely rare in machine learning: a categorical encoding that…
Read tutorial
You fit a linear model. The coefficients look sensible. Each feature seems to contribute its own share, and the numbers align with your intuition. Then you…
Read tutorial
You train the same model twice on the same data. The only difference: you scaled the features before the second run. The results are not slightly…
Read tutorial
You're staring at a wide table of columns, and the model is underperforming. The fix could mean deleting half the columns, reshaping the ones that remain,…
Read tutorial
Most people assume a machine learning model reads a spreadsheet the way a person does—scanning row by row, comparing values column by column. It does not.…
Read tutorial
You fit a model to something like house prices or income. Most values bunch on the left, and a long tail stretches to the right. The model behaves…
Read tutorial
Every supervised learning problem is a question about a table. The hard part is knowing which columns the model is allowed to look at.
Read tutorial
Picture a point sitting exactly between two well-separated blobs of data. K-means will force it into one group or the other, even when the data could…
Read tutorial
Linear regression draws a straight line through continuous numbers. Logistic regression draws an S-curve that outputs probabilities. They look like…
Read tutorial
Naive Bayes and logistic regression can classify the same dataset with nearly the same accuracy, yet they behave very differently on small samples, missing…
Read tutorial
Random forests grow many trees independently and average their votes. Gradient boosting grows trees one at a time, each one aimed at the mistakes the…
Read tutorial
A model starts with random parameters and ends up making sharp predictions. Nobody tells it the answer. It just keeps nudging itself in the right direction…
Read tutorial
You train a model. Cross-validation gives you a confident accuracy score. You deploy. The model underperforms in ways your validation never hinted at.
Read tutorial
Most beginners ask the wrong question first. They ask, "Which clustering algorithm is better?" The real question is, "Which question am I actually trying…
Read tutorial
Your best tuning score is not your model's true performance. It is the score of the luckiest experiment you ran.
Read tutorial
You train a model, split your data randomly, and the test score looks great. Then the model meets real-world data and quietly falls apart. The usual…
Read tutorial
A model that predicts "no fraud" for every transaction can score 98% accuracy while catching zero fraud. The number feels trustworthy. It is not. Accuracy…
Read tutorial
You load a saved model, feed it a fresh batch, and get predictions back. No error. No warning. Just numbers that look perfectly reasonable—except a column…
Read tutorial
"The model says education matters" sounds like a complete explanation. It is not. It is the beginning of a much narrower claim: the model leaned on…
Read tutorial
Two models trained on the same data can look at a new point and give you sharply different answers. Neither one is broken. Each is answering a different…
Read tutorial
You've added features. You've tuned hyperparameters. You've tried a more flexible model. And still, validation performance sits at the same stubborn…
Read tutorial
If you are like most beginners, you start guessing. Maybe more data will fix it. Maybe a bigger model. Maybe fancier features. You try one, see little…
Read tutorial
You have probably heard the advice: "Just use a random forest. Trees handle everything." It sounds practical. It is also how many beginners end up with a…
Read tutorial
Most introductions to linear regression make it sound like drawing a line through some dots. That description is true and almost useless. Any line can be…
Read tutorial
A logistic regression prediction is not a label. It is a probability—and the label is a decision you make on top of that probability.
Read tutorial
Most people assume a machine learning model learns to be right. It doesn't. A model learns to minimize a number you hand it—and that number is the loss…
Read tutorial
You train your first classifier. It hits 85% accuracy on the test set. You feel great—until you realize that a rule which ignores your data entirely would…
Read tutorial
Your model is only as smart as the table you hand it. Most beginners skip straight to fitting an algorithm, then blame the model when results disappoint.…
Read tutorial
A model that scores 90% accurate can still fail at the exact job it was built for. The headline number looks impressive, but it may be hiding a model that…
Read tutorial
Most beginners treat machine learning as a collection of algorithms to memorize. They collect names like trading cards—logistic regression, random forest,…
Read tutorial
You've said it yourself at least once: "The algorithm predicted the house price." Or maybe: "The model learned from the data." These sentences feel right.…
Read tutorial
AI, machine learning, and deep learning are not rivals competing for the same title. They are nested categories, each living inside the next.
Read tutorial
You do not need to finish a mathematics degree before you train your first model. You need enough math to understand what the model is doing—and you can…
Read tutorial
Every beginner hits the same wall: you load a real dataset, and it is full of holes. Columns you need are dotted with NaN. Your model refuses to run. So…
Read tutorial
Here is the trap I see beginners fall into constantly: they try five algorithms, compare the scores, keep the winner, then tweak it, compare again, and…
Read tutorial
Most people assume multiclass classification is just binary classification with more labels. It is not. The real problem is that many classical models only…
Read tutorial
Most classification tutorials teach you to pick one answer. A news article is politics or finance. A movie is action or comedy. A support ticket is billing…
Read tutorial
You open a dataset, and the last few columns all look like answers. One column says the fruit is an apple. The next says it is red. A third says it is…
Read tutorial
Most classifiers earn their keep by capturing relationships between features. Naive Bayes does the opposite: it assumes those relationships don't exist.…
Read tutorial
You run a grid search, watch the cross-validation score climb, and feel good about the model you are about to ship. Then the model lands on real data and…
Read tutorial
You have already done the thing this article is about. You looked at a column of raw numbers, decided that a ratio or a logarithm would be more useful,…
Read tutorial
Your data is clean. Your rows are ready. Then you feed the model a column of colors—"red", "green", "blue"—and it refuses to train. The error message is…
Read tutorial
A rating scale looks like it should be either a multiclass problem or a regression problem. Both instincts quietly discard the information that matters…
Read tutorial
Every beginner hits the same fork in the road. You plot your data, spot a few points sitting far from the pack, and freeze. Delete them? Keep them? The…
Read tutorial
Your model just aced its training data. Ninety-eight percent accuracy. Beautiful curves. Then you hand it new examples, and it stumbles like it never saw…
Read tutorial
Most people assume PCA "removes unimportant features." It does not. It rotates your data into new directions ranked by variance, then drops the quietest…
Read tutorial
You have a wide table of features, a model to build, and a quiet suspicion that half those columns are noise. The instinct is to shrink the dataset. But…
Read tutorial
You fit a straight line to data that clearly curves, and the line misses everything. Not by a little—systematically. It sits above the points in one…
Read tutorial
A regression model hands you one number. The person acting on that number needs to know how much weight it can bear. A prediction interval is how you show…
Read tutorial
A model can rank every case perfectly and still hand you probabilities you cannot spend. Calibration is the difference between a score that orders risk and…
Read tutorial
A single decision tree can feel like a confident liar: it nails your training data, then wobbles on new data, and reshapes its entire structure when one…
Read tutorial
"Extra Trees" does not mean more trees. It means extra randomness — and that single distinction changes how the ensemble learns, how fast it trains, and…
Read tutorial
You have data. You have a prediction goal. And you're stuck on a question that feels like it should be simple: should I use regression or classification?
Read tutorial
Regularization is not a magic switch that makes every model better. It is a deliberate trade: you give up a little accuracy on your training data to gain…
Read tutorial
You tune a model, retrain, and the score moves. The question is whether that movement came from your edit or from luck. Most beginners cannot tell the…
Read tutorial
A regression model reports a solid R-squared, so you call it done. Then you plot the predictions against the actual values and notice something…
Read tutorial
You train a fraud detector on a dataset where only 0.5% of transactions are fraudulent. The ROC AUC comes back at 0.95. You feel great. Then you look at…
Read tutorial
You trained a model. It scored well. You saved it with a sigh of relief. Then, weeks later, you load it, feed it new data, and get predictions that are…
Read tutorial
You fit a scaler on your full dataset, split into training and test sets, train a model, and watch it score beautifully. Then the model meets real data and…
Read tutorial
You one-hot encoded a categorical column and watched it explode into hundreds of columns. Now your dataset is mostly zeros—and your first instinct might be…
Read tutorial
You have your features. You have your target. You are about to reach for a classifier — and then you freeze on a question that feels too basic to ask out…
Read tutorial
You have heard both terms. You can even recite rough definitions. Then you open your own dataset, stare at the columns, and freeze. Is this supervised or…
Read tutorial
Most machine learning models are hoarders. They keep every training point around and let each one vote on the prediction. A support vector machine is the…
Read tutorial
Target encoding is one of the most seductive traps in feature engineering. You encode a high-cardinality feature like city or merchant_id, watch your…
Read tutorial
You've trained a model. The accuracy looks great. You're ready to ship it. Then someone asks the question that stops every beginner cold: How do you know…
Read tutorial
You run PCA on your data and get one picture. You run t-SNE on the same data and get a completely different one. One shows two messy blobs. The other shows…
Read tutorial
More models do not automatically mean a better model. An ensemble only wins when its members make different mistakes—and the way you combine them…
Read tutorial
Most people assume machine learning means teaching a computer to think like a human. It doesn't. It means showing a computer enough examples that it finds…
Read tutorial
You have a tabular dataset, a prediction to make, and a list of algorithm names that reads like a menu in a language you have not learned yet. Random…
Read tutorial
XGBoost has a reputation problem. It gets treated like a secret weapon—a mysterious algorithm that wins competitions and powers production systems while…
Read tutorial