Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

name: op-attr-reg-fitted
description: Per-row fitted value ŷᵢ = Xᵢ · β + β₀ from an OLS refit during the attribute prepass.
kind: operator
category: ATTR
operator: ATTR_REG_FITTED
type: reference
applies_to: process, compose, predict
examples_tags: [regression, ols, buffered-pipeline]

Attributes emit row-level scalars; they do not produce Response.Components.

Use when

Adds to every row the value a straight-line model predicts for its target from its predictors.

Questions it answers:

  • What order value would we expect for each customer given their visits and tenure?
  • Which stores sell above or below what their size and footfall predict?

Use something else:

  • REG_OLS when you want the coefficients, R-squared and p-values of the model.
  • REG_GLM when the target is yes/no or a count.

Params

NameTypeDescription
TargetstringDependent field (required).
Predictors[]stringIndependent fields (required).
Penaltyenum"", l1, l2, elasticnet.
AlphafloatRegularization strength.
L1RatiofloatElasticnet mix.
weightslot weightnull opts out; REG_OLS’s kinds: WLS refit; residual raw y − ŷ.

Inputs

ParamAccepted field types
Target / Predictorsnumeric (no decimal128)
Labelrequired — new column name

Output

One float64 per record — the model’s prediction ŷᵢ. Null (never 0) when any predictor is null, so a downstream aggregation counts the row in n_null; a null target alone still gets ŷᵢ.

Reading the output

  • value: The target value the fitted straight-line model predicts for the row from its predictors: intercept + sum(coefficient * predictor), in the target’s units. The model is fitted by least squares to the rows that passed the filters and have the target and every predictor.
    • Caveat: The model describes association in these rows: a fitted value is what rows with these predictor values look like here, not what would happen to a row if a predictor were changed; a causal reading needs a design that supports it.

Gotchas

  • Two-pass: prepass refits independently per ATTR_REG_* slot (Option A — no fit sharing).
  • Mergeable per-shard; predict reports streamability.
  • Penalized fits (l1/l2/elasticnet) reuse the same machinery; mis-tuned Alpha/L1Ratio shrinks coefficients toward zero.

See