Skip to content

ML.INSPECT.INTERCEPT

Returns the intercept (bias term) of a fitted linear model.

Syntax

ML.INSPECT.INTERCEPT(model)

Arguments

Name Type Default Description
model object Fitted linear model with an intercept_ attribute (e.g. created by ML.REGRESSION.LINEAR/RIDGE/LASSO and trained with ML.FIT).

Returns

The intercept (bias term) of a fitted linear model as a single number.

When to use

Use ML.INSPECT.INTERCEPT to read the intercept_ value from a fitted linear model — LinearRegression, Ridge, Lasso, LogisticRegression (binary), and similar single-output estimators. The intercept is the value the model predicts when every feature is exactly 0; together with the coefficients it fully describes the linear equation the model learned.

Pair it with ML.INSPECT.COEFFICIENTS to read out the full equation — useful for explaining what the model is doing in plain Excel terms, or for comparing how regularization shifts the intercept across Linear / Ridge / Lasso.

Examples

Train a Ridge regression and read the intercept and coefficients side-by-side:

=ML.REGRESSION.RIDGE(1.0)
=ML.FIT(K1, A2:H100, I2:I100)
=ML.INSPECT.INTERCEPT(K2)
=ML.INSPECT.COEFFICIENTS(K2)

Remarks

  • The model passed in must already be fitted and must expose an intercept_ attribute. If the model was constructed with fit_intercept=FALSE, the intercept will still be present but equal to 0.
  • Only single-output models are supported (one regression target, or binary classification). Multi-class LogisticRegression and multi-output regression raise an error — they would produce one intercept per class or per output, which doesn't fit a single cell.
  • The intercept is in the original units of the target. If the target was scaled before fitting, the intercept reflects the scaled units, not the original ones.
  • For a single-feature regression, the intercept is the y-axis value where the best-fit line crosses x = 0. For multi-feature models, the geometric meaning is harder to picture but the math is the same: it's the constant term in the linear equation the model learned.

See also