Intuition The One Core Idea
A learning model can only see relationships you have already written into the columns of your data — if the pattern isn't in a feature, no training will find it. Feature creation is the craft of building brand-new columns (products, ratios, powers) so that even a simple straight-line model can trace a curved or "it depends" relationship.
This page assumes nothing . Every letter, subscript, and squiggle used in the parent note (the topic note) is unpacked here, one at a time, each building on the last. If a symbol confused you upstairs, it is defined below with a picture.
Definition Feature, sample, and the data table
A feature is one measured quantity — one column in a spreadsheet. A sample (or row) is one thing you measured — one house, one day, one customer. The whole dataset is a grid: rows are samples, columns are features.
Look at the figure. Each column is a feature (say temperature ). Each row is a sample (one day's record). "Creating a feature" literally means drawing a new column whose values are computed from the existing ones. That is the entire game.
x , and the subscript x i
The letter x is a stand-in for "the value of a feature." Because we usually have many features, we tag them with a small number underneath — the subscript . So x 1 means "feature number 1," x 2 means "feature number 2," and x i means "feature number i ," where i is a placeholder for whichever one we're talking about .
Picture a row of labelled boxes: box x 1 holds the temperature, box x 2 holds the rainfall. The subscript is just the address of a box.
x — the whole row at once
When we write the whole list of features together we bold it: x = [ x 1 , x 2 , … , x n ] . The plain x (no bold) is one number; the bold x is the entire row of numbers . The three dots … mean "keep going the same way," and n is the count of features — the last box's address.
x i vs x 2
x i (subscript, low) is an address — which feature. x 2 (superscript, high) is a power — the feature multiplied by itself. Same letter, totally different jobs. Low = label, high = maths.
⋅ and ×
Both symbols mean multiply . x 1 ⋅ x 2 and x 1 × x 2 both say "take feature 1's value times feature 2's value." We prefer the dot ⋅ next to letters (so it's not mistaken for the letter x) and × when we want to shout "these two interact."
Why does the topic care so much about a humble multiply sign? Because multiplication is how you encode "it depends" — see §6.
w , bias b , prediction y
A model guesses an answer y (e.g. crop yield) by weighting each feature and adding them up:
y = w 1 x 1 + w 2 x 2 + b
w 1 , w 2 are weights — dials the model turns to say how much each feature matters . Big weight = strong influence.
b is the bias — a constant baseline added no matter what the features are (the value of y when all features are zero).
y is the prediction — the number that comes out.
Intuition Why "linear" means "straight"
In the figure, plot one feature x 1 across the bottom and the prediction y up the side. The equation y = w 1 x 1 + b draws a straight line : b is where it crosses the axis (the height at x 1 = 0 ), and w 1 is its steepness (rise over run). Turning the weight tilts the line; turning the bias slides it up or down. A straight line is all this model can draw — and that is exactly the limitation feature creation exists to fix.
Real relationships bend. Crop yield rises with temperature, peaks, then falls when it's too hot. That shape is a hill , not a line — a straight line can never trace it.
x 2 and what it draws
x 2 means x × x . Plotted against x , the values … , 4 , 1 , 0 , 1 , 4 , … trace a U-shaped curve called a parabola.
Look at the two coloured curves. A positive weight on x 2 gives a valley (U); a negative weight flips it into a hill (∩) — exactly the "peaks in the middle" shape crop yield needs. This is why the topic adds x 2 as a new feature: it lets the straight-line machinery draw curves. That trick is called a polynomial feature .
Definition Polynomial and degree
A polynomial is a sum of a variable raised to whole-number powers, e.g. w 1 x + w 2 x 2 . The degree is the highest power present. Degree 1 = straight line; degree 2 = one bend; degree 3 = two bends; and so on.
The parent counts how many new features appear. That count uses a special symbol.
( d n ) — "n choose d"
( d n ) (read "n choose d" ) counts how many different groups of size d you can pick from n items, when order doesn't matter. It is computed as
( d n ) = d ! ( n − d )! n !
where the exclamation mark n ! (a factorial ) means "multiply every whole number from 1 up to n ": 4 ! = 4 ⋅ 3 ⋅ 2 ⋅ 1 = 24 .
Worked example Counting degree-2 features for
n = 2
With 2 features at degree 2 , the number of new terms is ( d n + d ) − 1 = ( 2 4 ) − 1 .
( 2 4 ) = 2 ! 2 ! 4 ! = 2 ⋅ 2 24 = 4 24 = 6 , 6 − 1 = 5.
The five new features are x 1 , x 2 , x 1 2 , x 1 x 2 , x 2 2 . We subtract 1 because the constant term is already covered by the bias b .
Why does the topic need this symbol? To warn you : the feature count explodes as degree grows, which drives the "combinatorial explosion" mistake in the parent note.
This is the heart of the topic, so we build it fully.
Definition Interaction term
An interaction term is a new feature made by multiplying two existing features : x 1 ⋅ x 2 . Adding it gives
y = β 1 x 1 + β 2 x 2 + β 3 ( x 1 ⋅ x 2 ) + b .
(The Greek letter β , "beta," is just another name for a weight — statisticians write β where ML writes w . Same thing.)
Why multiplication and not, say, addition? Watch what algebra reveals. Group every term that contains x 1 :
y = x 1 ( β 1 + β 3 x 2 ) + β 2 x 2 + b .
Intuition The "effective slope" picture
The quantity in the bracket, β 1 + β 3 x 2 , is the effective weight on x 1 — and it changes as x 2 changes . When x 2 is small the slope is nearly β 1 ; when x 2 is large the slope shifts by β 3 x 2 . So the line for x 1 tilts differently at different x 2 . That is the mathematical face of "it depends" — the effect of ad spend depends on whether it's the weekend.
In the figure, the two lines are the same feature x 1 at two settings of x 2 : same idea, different steepness. A model without the interaction is forced to use one slope for both — it literally cannot draw two.
x j x i and difference x i − x j
The fraction bar means divide : x j x i answers "how many times bigger is x i than x j ?" — it strips away raw scale and leaves relative size (debt relative to income). The minus x i − x j gives change or gap (today's price minus yesterday's).
Intuition Why dividing "normalizes"
$50k debt is scary on $30k income (ratio 1.67 ) but fine on $200k income (ratio 0.25 ). Dividing folds both numbers into one scale-free value, so the model compares burdens, not dollars. (More on making features comparable in scale: Feature Scaling and Normalization .)
The parent's distance formula uses two Greek letters you can now decode:
ϕ (phi ) = latitude (how far north/south), λ (lambda ) = longitude (how far east/west), r = Earth's radius.
sin , cos , arcsin are trig functions that convert angle differences on a sphere into a straight-line-on-the-globe distance. You don't need to derive them here — just know each symbol names a real, pictured quantity (an angle or a radius), never a free-floating letter.
Data table rows and columns
Feature x and subscript i
Linear model weights w and bias b
Polynomial features and degree
Choose symbol counts features
Interaction term x1 times x2
Effective slope depends on other feature
Ratio and difference features
Cover each answer and test yourself; reveal only after you've tried.
What does a subscript x i tell you? Which feature — it is an address/label, not a maths operation.
How is x i different from x 2 ? Low i = which feature (label); high 2 = power (multiply the feature by itself).
What do the bold x and the plain x each mean? Bold x is the whole row of features; plain x is a single feature value.
In y = w 1 x 1 + b , what do w 1 and b control on the graph? w 1 is the line's steepness (slope); b is its height where x 1 = 0 (intercept).
Why can't a linear model draw a hill shape? A linear (straight-line) model has no term that bends — it needs a created feature like x 2 to curve.
What shape does x 2 draw, and how do you flip a U into a hill? A parabola (U-shape); a negative weight flips it into a ∩ (hill).
What does ( d n ) count, and what is 4 ! ? The number of ways to choose d items from n ; 4 ! = 4 ⋅ 3 ⋅ 2 ⋅ 1 = 24 .
Compute ( 2 4 ) − 1 and say what it counts. 6 − 1 = 5 — the new degree-2 features for 2 inputs: x 1 , x 2 , x 1 2 , x 1 x 2 , x 2 2 .
Why is an interaction made by multiplying, not adding? Multiplying makes the effective slope of one feature ( β 1 + β 3 x 2 ) depend on the other — encoding "it depends."
What does a ratio x i / x j give you that raw numbers don't? A scale-free, relative value (e.g. burden relative to income) instead of absolute magnitude.
What do ϕ and λ stand for in the distance formula? ϕ = latitude (north–south), λ = longitude (east–west).