Vol. 16 · ML & Decision Systems

Classical Machine Learning in Plain English

A cheat sheet for talking with ML specialists in one language: what are data, features, target, loss, generalization and prediction; what problems are solved by linear models, trees, SVM, kNN, ensembles, clustering and PCA; and why the transition to neural networks did not cancel the basic mechanics of errors and optimization, but scaled it.

Retrieval answer

A cheat sheet for talking with ML specialists in one language: what are data, features, target, loss, generalization and prediction; what problems are solved by linear models, trees, SVM, kNN, ensembles, clustering and PCA; and why the transition to neural networks did not cancel the basic mechanics of errors and optimization, but scaled it.

01

Foundation and vocabulary

5 cards
01FoundationWhat is ML in one scheme1 visual

Machine Learning is a way to teach a function to make useful predictions based on examples, rather than writing all the rules manually. We have data, a target variable, and a family of models. Training selects the model parameters so that the error on known examples becomes small, and then we use the same model on new objects.

02FoundationData language: sample, feature, target, label2 source notes

Most conversations in ML come down to a table. The row is the object of observation, the columns are the signs, and the target column is what we want to predict. Even if the data is not tabular by nature, they still try to bring it to such a representation.

Source-complete notesterms · example
termstext
X = feature matrix, shape: [n_samples, n_features]
y=target/labels

sample/instance/row:
  one row of data

feature:
  one measurable characteristic

target:
  what we want to predict

label:
  target in a classification problem

example

  • sample = one client
  • features = age, check, city, activity
  • target = will leave / will not leave
03FoundationWhat it does "prediction" really mean?1 source note

Prediction in ML is not just about “guessing the future number”. The model can produce a number, class, probability, score, ranking score, embedding or cluster id. In real systems, what is often more important is not the final class, but the intermediate score, which is then cut by a threshold or goes into downstream logic.

Source-complete notestable
TaskModel outputWhat are they doing with it?
Regressionnumberprice, demand, time, risk
Classificationprobability / classthreshold, alert, routing
Rankingscoresorting candidates
Clusteringcluster idsegmentation and analysis
PCA / embeddingsnew vectorvisualization, retrieval, downstream model
04FoundationThe formula for almost everything ML: family + loss + optimizer + regularization2 source notes

Almost any ML pipeline can be reduced to one template. You choose a family of functions, set a measure of error, sometimes add a complexity penalty, and then the optimizer looks for good parameters. Further, all engineering revolves around data quality, choice of loss, metrics, regularization and the ability of the model to generalize.

Source-complete notesgeneralized objective · typical loss
generalized objectivesql
find θ that minimizes:

  J(θ) = (1 / N) Σ_i L(f(x_i; θ), y_i) + λΩ(θ)

where:
  f(x; θ) = model
  L = loss using one example
  Ω(θ) = difficulty penalty
  λ = regularization strength

Linear regression, logistic regression, boosting, and neural networks are built around this formula

typical loss

  • MSE for regression
  • log loss for classification
  • hinge loss for SVM style
  • within-cluster sum of squares for k-means
05FoundationTraining, inference, generalization - three different modes1 visual

Beginners often confuse learning and using the model. During training the parameters change. During inference, the parameters are frozen and the model only calculates the output. And generalization is the main question: how well does the frozen model work not on familiar examples, but on new ones.

Visual model · Process flowFollow the sequence behind Training, inference, generalization - three different modes and locate where work or state changes.
Complete view · 5 layers
02

How a model learns

4 cards
06LearningGradient Descent: Descent by mistake2 source notes

Not all models are trained with gradient descent, but it is one of the central mechanisms of ML. The idea is simple: see how the loss changes with small changes in parameters, and shift the parameters to where the error drops. This same thinking then goes directly into neural networks.

Source-complete notesminimal mechanics · important nuances
minimal mechanicssql
init θ randomly or by heuristic
repeat:
  y_hat = f(X; θ)
  loss = L(y_hat, y)
  grad = ∂loss / ∂θ
  θ = θ - η * grad

where:
  η = learning rate

important nuances

  • too small step = long
  • too big step = fly apart
  • SGD = count the gradient by batches, not by the entire dataset
07LearningOverfitting vs Underfitting1 visual

Underfitting means that the model is too weak and cannot catch the structure even on train. Overfitting means the opposite: the model has adapted too well to train noise and loses quality on new data. In ML, almost everything revolves around finding a balance between these two extremes.

Visual model · Annotated exampleInspect the concrete example behind Overfitting vs Underfitting, one layer at a time.
Complete view · 4 layers
08LearningRegularization: penalty for excessive complexity1 source note

Regularization is needed to prevent the model from using too “aggressive” parameters or too complex rules. In linear models these are L1/L2 weight penalties. In trees, these are restrictions on the depth and size of leaves. In boosting this is shrinkage, the number of trees and early stopping.

Source-complete notesforms of regularization
forms of regularizationtext
linear models:
  L2: + λ ||w||²
  L1: + λ ||w||₁

trees:
  max_depth
  min_samples_leaf
  pruning

boosting:
  learning_rate
  max_depth
  n_estimators
  early_stopping
09LearningTrain / Validation / Test and Cross-Validation1 visual1 source note

An ML model cannot be fairly evaluated on the same data on which you selected the hyperparameters. Therefore, the data is divided into train, validation and test. When there is not enough data, they use cross-validation: they retrain the model several times on different folds and average the quality.

Visual model · Formula mapConnect the quantities and operations that determine Train / Validation / Test and Cross-Validation.
Source-complete notesantipatterns

antipatterns

  • select a model using test set
  • normalize the entire dataset to split
  • keep test as "last exam"
03

Types of tasks

4 cards
10TaskRegression: predicting a number1 source note

Regression is a task where the target is continuous: price, delivery time, sales volume, probability of default as a number from 0 to 1, temperature, lifetime value. The main question here is not “to which class to classify”, but “how large the output will be.”

Source-complete notesexamples
examplestext
x = apartment
y = price

x = client + context
y = expected revenue

x = ticket
y = solution time
11TaskClassification: predicting class1 source note

Classification is tasks with discrete tags: spam / not spam, fraud / not fraud, product class, text language, disease. Often, the model first produces a probability or score, and only then the system turns it into a class through a threshold.

Source-complete notesoptions

options

  • binary classification
  • multiclass classification
  • multilabel classification
  • class imbalance is often more important than the model itself
12TaskScore, probability, threshold, ranking are not the same thing1 visual1 source note

In many systems, the model does not produce a final solution, but a score. This score can be calibrated to probability, cut by a threshold, or used only for ranking. Conversations about precision/recall and business trade-off almost always revolve around this layer, and not around the “model architecture”.

Visual model · Formula mapConnect the quantities and operations that determine Score, probability, threshold, ranking are not the same thing.
Source-complete notesconsequences

consequences

  • For ranking, order is important, not calibration
  • for alert systems, the threshold is adjusted to the cost of errors
  • accuracy can hide a bad threshold
13TaskUnsupervised tasks: no target tag1 source note

In unsupervised learning there is no ready-made `y` that the model must guess. Instead, they look for structure in the data itself: groups of similar objects, low-dimensional representation, density, outliers. This is often not a “prediction” in the narrow sense, but a way to organize the feature space.

Source-complete notestypical modes
typical modessql
clustering:
  find groups of similar objects

dimensionality reduction:
  compress data into fewer coordinates

anomaly detection:
  find points that are not similar to the norm

density estimation:
  assess where data “lives” in space
04

Basic supervised models

6 cards
14ModelLinear models: the most important baseline2 source notes

Linear models assume that the final response can be expressed as a weighted sum of features. They are not always the most accurate, but they are almost always needed as a baseline: they are fast, understandable, cheap, easy to debug, and show well whether there is at least a simple signal in the data.

Source-complete noteslinear model kernel · when you are strong
linear model kerneltext
y_hat = w₀ + w₁x₁ + w₂x₂ + ... + w_px_p

Linear Regression:
  minimizes MSE / residual sum of squares

Ridge:
  the same linear model + L2 penalty

Lasso:
  the same linear model + L1 penalty
  may nullify some signs

when you are strong

  • clear numeric/tabular data
  • interpretable baseline
  • difficult to catch complex nonlinearities without feature engineering
15ModelLogistic Regression: linear classification via probability1 source note

Despite the name, logistic regression solves the classification problem. It builds a linear score, then passes it through the logistic function and gets the class probability. Therefore, this is one of the most standard and strong baselines for binary classification.

Source-complete notesessence
essencepython
score = w x + b
p(y=1|x) = sigmoid(score)

if p > threshold:
  class = 1
otherwise:
  class = 0

loss:
  log loss / cross-entropy
16Modelk-Nearest Neighbors: predict by neighbors1 visual

kNN teaches almost nothing in the classical sense: it stores train examples and, with a new request, looks for the nearest objects in the feature space. For classification it does voting, for regression it averages the target neighbors. This is a very intuitive, but sensitive to the scale of features and the size of the dataset.

Visual model · Formula mapConnect the quantities and operations that determine k-Nearest Neighbors: predict by neighbors.
17ModelNaive Bayes: fast probabilistic approximation1 source note

Naive Bayes relies on the Bayes theorem and a rough but convenient assumption: features are conditionally independent given a fixed class. This assumption is often literally false, but the model can still perform surprisingly well, especially in text classification and as a very fast baseline.

Source-complete notesidea
ideatext
P(y | x₁...x_n) ∝ P(y) * Π_i P(x_i | y)

"naive" = we consider the signs to be independent

pros:
  fast fit
  fast predict
  good on sparse text

cons:
  strong assumption of independence
18ModelSVM: find the dividing border with maximum margin1 visual

Support Vector Machine builds a dividing surface between classes so that the distance to the nearest training examples is maximum. In the linear case, this is a neat geometric model of the boundary. With the kernel trick, SVM can also work with nonlinear partitions, although it scales worse than modern tabular ensembles.

Visual model · Annotated exampleInspect the concrete example behind SVM: find the dividing border with maximum margin, one layer at a time.
Complete view · 4 layers
19ModelDecision Tree: if-else rules learned from data1 source note

Decision tree builds a tree of conditions like `if age < 30 and income > 100k`. At each node, it selects the partition that best reduces impurity or error. Trees are easy to read, they are able to catch nonlinearities and interactions of features, but alone they are unstable and prone to overfit.

Source-complete noteshow does a tree think
how does a tree thinkpython
if feature_7 < 13.5:
  go left
else:
  go right

repeat until sheet

leaf:
  class = majority label
  or
  value = average target
05

Ensembles and unsupervised models

5 cards
20EnsembleRandom Forest / Bagging: many trees instead of one1 source note

Bagging reduces variance by averaging across many highly variable models. Random Forest is bagging over trees: each tree learns from a bootstrap subsample and a random subset of features. As a result, a forest is usually more stable and stronger than a single tree.

Source-complete notesrandom forest scheme
random forest schemepython
for t in 1..T:
  sample data with replacement
  sample subset of features
  fit deep decision tree

classification:
  final class = majority vote

regression:
  final value = average of trees
21EnsembleGradient Boosting: Correct the mistakes of previous trees1 visual1 source note

Boosting is not built as parallel voting, but as sequential error correction. Each new tree tries to improve where the current ensemble goes wrong. This is why gradient boosting and its successors often become the best models on tabular data with good feature preparation.

Visual model · Annotated exampleInspect the concrete example behind Gradient Boosting: Correct the mistakes of previous trees, one layer at a time.
Complete view · 5 layers
Source-complete notespractically

practically

  • often the best choice for tabular data
  • XGBoost / LightGBM / CatBoost - industry standard
  • requires careful tuning and leakage control
22UnsupervisedK-Means: partition points into K compact groups1 source note

K-means looks for `K` centers and assigns each point to the nearest one. Then the centers are recalculated as the average of their points, and the cycle is repeated. This is a simple and very popular method of segmentation if the clusters are approximately “spherical” and the number of groups is known in advance.

Source-complete notesk-means iteration
k-means iterationsql
1. select K centers
2. assign each point the nearest center
3. recalculate the center as the mean of the cluster
4. repeat until stabilized

goal:
  minimize within-cluster sum of squares
23UnsupervisedDBSCAN: clusters as dense regions, noise separately1 source note

DBSCAN does not require the number of clusters to be specified in advance. It looks at where the points are dense enough and considers such areas to be clusters. Objects that are not adjacent to any dense area are marked as noise. This is useful when clusters have complex shapes.

Source-complete noteswhen it's good

when it's good

  • free-form clusters
  • you need to catch the noise separately
  • worse at very different densities
24UnsupervisedPCA: compress data while preserving maximum variation1 visual

Principal Component Analysis looks for new axes in the data along which variation is greatest. Typically the first few components contain most of the "structure" of the data set. Therefore, PCA is used for visualization, dimensionality reduction, denoising, and feature preparation.

Visual model · Annotated exampleInspect the concrete example behind PCA: compress data while preserving maximum variation, one layer at a time.
Complete view · 5 layers
06

Practice and workflow

4 cards
25WorkflowFeature Engineering and preprocessing are half the model1 source note

In classical ML, the quality of features is often more important than the choice of algorithm. Normalization, one-hot encoding, gap handling, time aggregations, logarithms, feature interactions, target encoding and domain features can give a greater gain than changing the model from logistic regression to something “smarter”.

Source-complete notestypical preprocessing
typical preprocessingtext
numeric:
  impute missing
  scale/standardize

categorical:
  one-hot/target encoding

time:
  lags, rolling stats, calendar features

text:
  bag-of-words/TF-IDF/embeddings
26WorkflowMetrics: the model should be good at what you really care about1 source note

Loss, which the model optimizes, and the metric by which the business makes a decision do not have to coincide. For regression, large errors may be important to you, and for classification, the prices of false positive and false negative are asymmetrical. Therefore, a conversation about quality always begins with the question: which error is more expensive and what exactly do we want to optimize.

Source-complete notestable
Task typeMetricsWhat is measured
RegressionMSE, RMSE, MAE, R²average error size, variance explained
Classificationaccuracypercentage of correct answers
Imbalanced classificationprecision, recall, F1, PR-AUCbalance of false positives and omissions
Probabilitieslog loss, Brier scorehow good are the probabilities?
RankingNDCG, MAP, AUChow good is the order of objects
27WorkflowPipeline and data leakage1 visual

One of the most common mistakes is to first convert the entire dataset and then divide it into train/test. This is how the model accidentally learns information from the future test. The correct pipeline ensures that any fit occurs only on the train fold, and then the same transform parameters are applied to validation/test.

Visual model · ComparisonContrast the alternatives in Pipeline and data leakage under the same frame.
Complete view · 3 layers
28WorkflowNormal workflow: baseline → error analysis → tuning1 source note

An experienced ML process almost never starts with the most complex model. First, a simple baseline is built to understand the signal level in the data. Then they look at errors, fix symptoms and leakage, and only then tune the hyperparameters or move on to more powerful models.

Source-complete notesoperating procedure
operating proceduretext
1. understand the task and metric
2. make a simple baseline
3. check split / leakage / preprocessing
4. do error analysis
5. improve features
6. compare strong models
7. tune hyperparameters
8. think about sales and monitoring
07

Bridge to neural networks

3 cards
29BridgePerceptron: where classic ML begins to become a neural network1 source note

Perceptron is a very simple linear classification unit: it sums features with weights, adds bias and applies threshold activation. In fact, this is already a model of the form `score = w x + b`, only with a nonlinear decision rule. Historically, this is one of the bridges between linear models and neural networks.

Source-complete notesperceptron formula
perceptron formulapython
score = w x + b

if score > 0:
  y_hat = 1
else:
  y_hat = 0

update:
  if error:
    w = w + η (y - y_hat) x
30BridgeBackpropagation: the same conversation about the error, but through many layers1 visual1 source note

The key transition to neural networks did not occur because “different mathematics” suddenly appeared in them. The main idea remains the same: there is loss, there are parameters, we need to reduce the error. The novelty of backprop is that it can effectively distribute the error contribution back through many intermediate layers according to the chain rule.

Visual model · Process flowFollow the sequence behind Backpropagation: the same conversation about the error, but through many layers and locate where work or state changes.
Complete view · 5 layers
Source-complete notesvery short
very shorttext
forward pass:
  count y_hat

loss:
  measure error

backward pass:
  find ∂loss / ∂w for all weights

update:
  w = w - η * gradient
31BridgeWhat neural networks have changed and what remains the same1 source note

Neural networks have changed, first of all, the power of the function and the way of working with features: now the model itself learns the representations, and does not depend so much on manual feature engineering. But the basic ML language has not gone away. There are still data, loss, train/val/test, overfitting, regularization, gradient descent and metrics.

Source-complete notestable
Remains the sameHas changed a lot
X, y, loss, metrics, generalizationscale of parameters and calculations
train / val / testthe model itself teaches the signs
error optimizationdeep multi-layer views
regularization and fight against overfitnew architectures: CNN, RNN, Transformer

No dead end

Keep moving through the map.

Continue in sequence, switch to a related guide, or return to the seven-track learning map.

Discovery graph / next reads

Continue through New Runtime

Open the graph
  1. 01learning trackMl And Decision SystemsOpen the complete learning track.
  2. 02related materialStatistics for Evaluating LLM SystemsContinue with another guide in this learning track.
  3. 03related materialBERT, Encoders & Non-Generative ModelsContinue with another guide in this learning track.
  4. 04related materialForecasting, Causal Inference & BanditsContinue with another guide in this learning track.
  5. 05related materialAdvanced RAG: Context & EnrichmentContinue with a related New Runtime material.

These links are also published in this page’s JSON twin and as typed edges in DiscoveryGraph v1.

Who read this page?Machine requests, hidden until opened

Loading the privacy-safe route aggregate…

Open the JSON contract