← All nodes
Analytics

Linear Regression

Fits a least-squares line that predicts a number from one or more other columns, and adds the prediction to every row — including rows where the value to predict is blank.

When to use it

Use it to estimate a measure from its drivers (revenue from spend, time from distance) and to fill in predictions for new rows.

In a pipeline

Settings

SettingTypeRequiredDefault or hint
Predict (number column)selectYesSelect column…
From columns (features)selectYesPick the columns that explain it
Prediction column nametext—Default: Prediction
Add a Model column (JSON for Score Model)checkbox—false

Example

Revenue from spend

  • Predict (number column)=Revenue
  • From columns (features)=Spend
Spend and revenue; the last row is new
SpendRevenue
1025
2046
3064
4085
50—
Predictions, the new row included
SpendRevenuePrediction
102525.3
204645.1
306464.9
408584.7
50—104.5

The run notes say R² = 0.999 and give the model: {"type":"linear","target":"Revenue","features":["Spend"],"intercept":5.5,"coefficients":{"Spend":1.98}}.

Worth knowing

  • The model is learned from rows with numbers in every picked column; any row with numbers in the From columns gets a prediction.
  • The model is not saved anywhere: copy its JSON from the notes into Score Model, or tick Add a Model column to carry it down the flow.
  • Money, percentages and thousands separators are read as numbers ($1,240 is 1240).
  • If two From columns say the same thing (one is a multiple of another), the node stops and names them.

Others in Analytics