Exploring Machine Learning Algorithms

data cleaning, data cleansing, data scrubbing, data quality, data management, data analysis, data accuracy, data consistency, data completeness, data enrichment, data validation
What is Data Cleaning?
Balancing act, ALIREZA RASHIDI
Balancing ACT


The Algorithm Garden — A Friendly Tour of Machine Learning
Ali’s Field Notes · Machine Learning

ML isn’t magic. It’s a toolbox.

Machine learning is a set of tools, not a spell. From teaching puppies to folding maps, this is your friendly tour of the algorithm families — what each one is for, and how to pick the right one before you write a line of code.

The first time I trained a model, it felt like teaching a curious puppy to fetch — clumsy at first, then surprisingly good. Features beat fancy. Clean data wins.

01The first question

Start with the question#

Before names or math, ask: what do you want to discover? Pick the right tool, plus a bit of care, and you get useful answers.

Predicting numbers?Supervised → Regression. Prices, demand, temperature — anything continuous.
Predicting categories?Supervised → Classification. Spam or not, churn or stay, A or B.
Finding groups?Unsupervised → Clustering. Segments you never named, waiting in the data.
Complex patterns?Deep Learning. Images, sound, and text where rules resist being written.
02The families

Three families, three temperaments#

Every algorithm you’ll meet belongs to one of these households. Learn the temperament of each and the names stop mattering.

Supervised learning is the workhorse of the industry. You show the model thousands of (input, correct answer) pairs, and it learns the mapping between them.

The algorithms

  • Linear Regression — “The Ruler”: draws the best straight line through the dots. Great for quick baselines like housing prices.
  • Logistic Regression — “The Yes/No”: estimates the chance something is A or B. Will a customer churn? Is this spam? Clean and reliable.
  • Trees & Forests — “The Flowchart”: splits data into simple rules (if > X then Y). Random Forests run many trees and vote, increasing stability.

Where it shines

  • Tabular data: spreadsheets, SQL tables, CRM exports — the everyday stuff of business.
  • Fast baselines: an answer today beats a perfect answer next quarter.
  • Interpretable models: when someone must explain the decision, trees and lines explain themselves.
Start here for almost any business table problem.Regression first, then Random Forest or Gradient Boosting.

Unsupervised learning receives data without labels and is asked to find structure. It is like giving a child a bucket of Lego bricks and watching them sort by color or size.

The algorithms

  • Clustering (k-Means) — “The Magnets”: toss magnets on a metal sheet; points pull toward the nearest magnet. Great for grouping similar customers.
  • PCA — “The Map Folder”: refolds a complex map so most of the variation fits into fewer directions — simplification without much loss.

Where it shines

  • Customer segmentation: discover groups you never named.
  • Anomaly detection: the points that belong to no cluster are the interesting ones.
  • Compression: 500 columns become 20 with most of the signal kept.
Best when you don’t yet know what question to ask.Explore first, label later.

When the signal hides inside pixels, waveforms, or sentences, stacked layers of simple units can surpass every classic model — at the cost of data, compute, and interpretability.

The architectures

  • CNNs: convolutional networks scan images with filters, catching edges, textures, then shapes.
  • Transformers: the modern standard for text — they pay attention to all words at once, powered by massive compute.
  • Neural Nets: stacked layers of simple units; given enough data, they learn features nobody could hand-design.

Where it shines

  • Images & audio: classification, detection, speech.
  • Text & code: understanding and generation.
  • Complex signals: anything where the rules resist being written down.
Reach for depth only when the problem is genuinely perceptual.A boosted tree still beats a neural net on most tables.
03Judging models

How to judge a model#

Overfitting is the classic pothole: you crush the training set, then stumble on new data. It is like memorising the answers instead of learning the subject.

The sweet spot (bias vs. variance)
0 25 50 75 100 Simple Balanced Complex Very Complex Model complexity → Error The sweet spot sits where test error bottoms out — before the curves diverge.
Training errorTest error (new data)

How to read this: as complexity grows, training error falls forever — but test error turns around and climbs. The best model lives at the bottom of the test curve, not the fanciest end of the axis.

Precision vs. recall

  • Precision — no false alarms: of everything I flagged, how much was real?
  • Recall — don’t miss the bad guys: of everything real, how much did I catch?
  • Choose based on what hurts more: a missed tumour or a false one is not a symmetric trade.

Split fairly

  • Train: the data the model learns from.
  • Validate: the data you tune decisions against.
  • Test: the data you touch exactly once, at the end.
04Field guide

A quick field guide#

What to try first when you land on a new planet.

ScenarioStart with…Then try…
Tabular data (Excel/SQL)Linear / Logistic RegressionRandom Forest or Gradient Boosting
Few rows, many columnsRegression + RegularizationPCA (simplify) before modeling
ImagesSmall CNNPre-trained ResNet/EfficientNet
Text / NLPBag-of-WordsTransformers (BERT/GPT)
AnomaliesIsolation ForestSimple thresholds

Models touch people. Check for bias. Monitor drift. Explain choices — a model that is fair and stable earns trust, and trust is your real metric.

05Choosing

Start small, stay honest#

The best practitioners are not the ones with the fanciest models — they are the ones whose baselines are clean, whose splits are fair, and whose metrics mean something.

What are you working with?

1
If it is a table, baseline with regression.

Then let Random Forest or Gradient Boosting try to beat it.

2
If it is pixels or sound, start with a small network.

Pre-trained models multiply small datasets.

3
If it is text, count words before you attend to them.

Bag-of-Words teaches you the vocabulary of your own problem.

4
If you hunt anomalies, isolate them.

And never underestimate a well-chosen threshold.

The honest loop: start small, split fairly, measure what matters, and only add complexity when the simple thing demonstrably fails.

A friendly tour for people who want intuition before equations.
Part of Ali’s Machine Learning Series · Updated 5 August 2026. Teaching charts are illustrative.
Ali Reza Rashidi
Ali Reza Rashidi
Ali Reza Rashidi, a Senior Data Scientist-Gen Al | Al Architect | MLOps with over ten years of experience, He is the author of three books that delve into the world of data and management.

Comments are closed.

error: Content is protected!