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]
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_OLSwhen you want the coefficients, R-squared and p-values of the model.REG_GLMwhen the target is yes/no or a count.
Params
Refit keys are top-level, not params; fit is params.fit (regression-row-scores).
| Name | Type | Default | Description |
|---|---|---|---|
target | field | (required) | Dependent field; absent with fit. |
predictors | list | (required) | Independent fields; absent with fit. |
penalty | enum | "" | "", l1, l2, elasticnet. |
alpha | float | — | Regularization strength. |
l1_ratio | float | — | Elasticnet mix. |
fit | string | — | Bound fit (fits / models), no refit: its score (a GLM’s fitted mean); no refit keys. |
carryover | bool | true | Carry adstock (regression-order). |
order | object | — | {field, partition?}; needed to carry. |
weight | slot weight | inherited | null opts out; a WLS refit; ignored with fit. |
Inputs
target / predictors: see ## Contract (decimal128 as its float64 echo, packed_bool 0/1).
label— default<TYPE>_<target>, withparams.fit<TYPE>_<fit>
Output
One float64 per record — the model’s prediction ŷᵢ. Null (never 0) when any predictor is null, NaN or ±Inf, 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.
Contract
- Types (
target,predictor):date,datetime,decimal128,f32,f64,packed_bool,u16,u32,u4,u64,u8; any other scalar type isPULSE_FIELD_TYPE_UNSUPPORTED. - Weight: weighted under
frequencyandprobabilityweights. - Streaming: streamable.
Gotchas
- Two-pass: each slot refits on its own. With
params.fitrow-local (two-pass withorder), the bound model’s score bit for bit; refusals, failed fit (PULSE_FIT_UNAVAILABLE, all null):regression-row-scores. - A penalty shrinks coefficients toward zero when
alpha/l1_ratiois mis-tuned.
See
pulse_examples_search tags=[regression]- Skills:
regression-row-scores,regression-modeling,attribute-composition,op-attr-reg-residual