Add one exact all-ones column before the feature columns.

highlighted = computed this step

Add the intercept column

X plus starts with an added column of 1s. Row A becomes [1,1,2].

X+=[112121133]X_+=\begin{bmatrix}1&1&2\\1&2&1\\1&3&3\end{bmatrix}
Feature Matrix ExactlyExact rows rewritten into X, y, and intercept X plus.rows to X, y, and intercept X plusrow idx1x2yX rowy entryX+ rowA125[1,2]5[1,1,2]B214[2,1]4[1,2,1]C338[3,3]8[1,3,3]feature order: x1, x2; row ids stay outside Xintercept column is all ones in X+feature matrix is a table rewrite from displayed rowsrow IDs stay outside X; intercept column is all onesNOT training; NOT learning; NOT predictionNOT accuracy; NOT generalization; NOT feature importanceNOT best features; NOT causal; NOT probability truth

The first column is pinned

Every intercept entry is exactly 1. It is not copied from the feature columns, y, or the row ID.

intercept column=(1,1,1)\text{intercept column}=(1,1,1)
Feature Matrix ExactlyExact rows rewritten into X, y, and intercept X plus.rows to X, y, and intercept X plusrow idx1x2yX rowy entryX+ rowA125[1,2]5[1,1,2]B214[2,1]4[1,2,1]C338[3,3]8[1,3,3]feature order: x1, x2; row ids stay outside Xintercept column is all ones in X+feature matrix is a table rewrite from displayed rowsrow IDs stay outside X; intercept column is all onesNOT training; NOT learning; NOT predictionNOT accuracy; NOT generalization; NOT feature importanceNOT best features; NOT causal; NOT probability truth

Adding a column is not fitting

The intercept column prepares a table shape. It does not choose coefficients or make predictions.

table shape only\text{table shape only}
Feature Matrix ExactlyExact rows rewritten into X, y, and intercept X plus.rows to X, y, and intercept X plusrow idx1x2yX rowy entryX+ rowA125[1,2]5[1,1,2]B214[2,1]4[1,2,1]C338[3,3]8[1,3,3]feature order: x1, x2; row ids stay outside Xintercept column is all ones in X+feature matrix is a table rewrite from displayed rowsrow IDs stay outside X; intercept column is all onesNOT training; NOT learning; NOT predictionNOT accuracy; NOT generalization; NOT feature importanceNOT best features; NOT causal; NOT probability truth