Five machine learning algorithms. One graph. That's the whole trick.
RickTheEngineer
Visit on Instagram@rick.theengineer
#machinelearning #datascience #artificialintelligence
Five machine learning algorithms. One graph. That's the whole trick.
Most explainers give each algorithm its own diagram, so you never actually see how they differ. This one puts all five on the SAME pair of axes — and the difference becomes the shape each one draws on it.
1 — LINEAR REGRESSION → draws a LINE
You run a delivery company. Distance in, minutes out. It finds the line with the smallest total error, then predicts a number. Real fit here: time = 7.6 + 2.52 × distance. A 12 km job → 37.8 minutes.
2 — LOGISTIC REGRESSION → draws an S-CURVE
Despite the name, it classifies. Will this subscriber cancel? The output isn't $37, it's a probability. 17 days since last login → 82% chance of churning. Cross your threshold and that user gets flagged high risk.
3 — DECISION TREES → draws RECTANGLES
Hip-hop? Yes. Energetic? Yes. Late at night? No. → Workout playlist. Here's the part nobody shows you: those three questions are literally cuts in the plane. The tree and the carved-up graph are the same object.
4 — SVM → draws a GAP
Two species of iris. Plenty of lines separate them — SVM finds the one with the widest possible gap. That gap is the margin (1.397 cm here), and it rests on just 3 points. Add the kernel trick and the boundary can curve: a straight line gets 60%, a curve gets 100%.
5 — KNN → draws NOTHING
No line, no curve, no tree. A new film lands in feature space, it checks the 5 closest, 4 are sci-fi, done. The trade-off: it never builds a model, so every prediction re-scans the whole library. 68 examples is instant. 4,200,000 is not.
The one-line version:
Linear predicts a number. Logistic predicts a class, with a probability. Trees decide by asking. SVM finds the widest boundary. KNN copies its closest neighbours.
Every number on screen came from an actual fitted model — and the flowers are the real Fisher iris dataset, not a drawing.
Which one finally clicked for you? 👇
#machinelearning #datascience #artificialintelligence #mlengineer #datascienceforbeginners
Comments
Comments from the original post on Instagram
No comments yet
