This page assumes you have never seen a single symbol from the parent note. We build each one from a picture before it is ever used. Read top to bottom; nothing appears before it is earned.
Before any math, fix the picture. Imagine a table. Each row is one thing you observed — one transaction, one medical scan, one email. Each column is a measured number about that thing — the amount of money, the tumor size, the number of links in the email.
Look at the figure: the black rows are samples, the black columns are features, and the single red column on the right is the label. That red column is the whole reason this topic exists — everything is about predicting it.
The parent note writes things like xi and xnew. What is that?
Why bold? Plain x means a single number. Boldx warns you: "I am not one number, I am a whole list of numbers travelling together." The parent note needs this because the oversampling technique on that page (which we will meet later and whose name spells out to Synthetic Minority Oversampling Technique) moves entire rows around in space, not one number at a time.
The little subscript is just a name-tag:
xi = "the i-th sample" (sample number i).
xj = "some other sample, number j".
xneighbor = "the sample sitting nearby".
xnew = "the brand-new synthetic sample we invent".
The double subscript xi,f means "sample i, feature f" — pick a row (i from 1 up), then pick a column (f from 1 up to F), and you get back one plain (non-bold) number.
Now we count rows by label — that is, by the value of yi.
In the figure, the tall black bar is Nmaj and the tiny red bar is Nmin. That gap between bar heights is the imbalance. Every technique tries to make those two bars the same height.
Why a ratio and not a difference? Because a difference of "9800 rows" means nothing on its own — 9800 out of ten billion is balanced, but 9800 out of 9900 is disaster. Dividing cancels the overall size and leaves the pure skew. This is exactly the reasoning behind why raw accuracy misleads (see 3.2.4-Precision-recall-and-F1-score).
Why the prime mark?Nmaj′ (read "N-maj-prime") means "the majority count after we edited it". The prime ′ is a bookkeeping tick: unprimed = before, primed = after. So Nmaj′=r⋅Nmin reads: "after editing, keep r times the minority count of majority samples."
The parent's undersampling "Loss" is:
Loss=1−Nmajr⋅Nmin
Read it piece by piece.
Why subtract from 1? Because "kept" and "lost" together must make the whole (100%). One is 1 minus the other. This tiny move — flip a keep fraction into a loss fraction — is worth memorising; it appears everywhere.
The oversampling technique needs to know which dots are "nearby". That needs a ruler. First, one tiny tool.
Look at the figure. The red line is the direct distance d. The two black legs are the differences in each feature. Squaring makes every difference positive (no cancelling), adding combines them, and the square root undoes the squaring to give back a real length in the same units as the axes.
So the general formula the parent writes,
d(xi,xj)=∑f=1F(xi,f−xj,f)2,
reads in words: "for every feature, take the gap, square it, add all the squares, then square-root the total."
Why "same class"? The oversampling technique only wants neighbours that are also minority (yi=1), so the invented point stays inside minority territory and never drifts into majority land.
The oversampling technique's heart is:
xnew=xi+λ(xneighbor−xi)
Read the figure with the formula:
(xneighbor−xi) is the arrow from the start dot to the neighbour dot (the black arrow).
λshrinks that arrow: λ=0 gives no movement, λ=1 gives the whole arrow.
Adding it to xislides you from the start dot part-way toward the neighbour.
So λ=0.4 lands the red synthetic dot 40% of the way along the segment. It is guaranteed to sit between two real minority dots — a plausible new example, never a wild outlier.
Every foundation above feeds one of the two parent techniques, which feed the topic. Undersampling needs only counting and fractions; SMOTE additionally needs distance, neighbours, and interpolation.