name: op-attr-reg-predict
description: Per-row score from a bound model (a compose `fits` entry or a loaded `models` file) — no refit; whole model or a terms subset.
kind: operator
category: ATTR
operator: ATTR_REG_PREDICT
type: reference
applies_to: compose, predict
examples_tags: [regression, ols, compose]
Use when
Adds to every row the value a model fitted once, elsewhere in the request, predicts for it from the row’s own predictor values.
Questions it answers:
- How close are the model’s predictions on weeks it was not fitted to (a holdout)?
- How much of each week’s sales does the TV term of the fitted model account for?
Use something else:
ATTR_REG_FITTEDwhen the model should be fitted to these same rows inside the slot.
Params
| Name | Type | Default | Description |
|---|---|---|---|
fit | string | (required) | Bound model name. |
terms | list | — | Subset of terms, (intercept) opt-in. Absent: whole model. |
scale | enum | response | GLM, ordinal, multinomial: response, link. |
bound | enum | point | point, lower, upper: ci bound × column. Needs terms = one predictor. |
carryover | bool | true | Adstocked-in-model fit: carry (needs order). |
order | object | — | {field, partition?} of raw spend (regression-order). |
output | enum | — | Ordinal / multinomial column (regression-row-scores). |
level | string | — | Ordinal level. |
category | string | — | Multinomial category. |
Inputs
- model predictors — numeric fields or earlier labels, by name
label— output name; defaultATTR_REG_PREDICT_<fit>
Output
One f64 per record; null when a value read is null, NaN or ±Inf, and on EVERY row when the fit failed on its data (PULSE_FIT_UNAVAILABLE; predict cannot foresee it). Training rows equal the fit’s fitted values bit for bit.
Reading the output
value: The target value the named fitted model predicts for the row from the row’s own predictor values: intercept + sum(coefficient * predictor) at the fit’s full precision, in the target’s units — for a GLM on the response scale (the inverse link applied: a probability, a count) unless scale is link. With terms, only the listed terms are summed: that part of the prediction, a contribution in the target’s units (link units for a GLM).- Caveat: A coefficient’s confidence bound gives the range of that one term, not a prediction interval for a row.
Contract
- Types:
date,datetime,decimal128,f32,f64,packed_bool,u16,u32,u4,u64,u8(each column the bound model reads); any other scalar type isPULSE_MODEL_PREDICTOR_NOT_NUMERIC. - Weight: not read; a weight in force is skipped.
- Streaming: streamable.
Gotchas
- The fit’s predictor list is authoritative: build the same fields (
regression-row-scores). - A coefficient bound is not a prediction interval. A term with no bound scores null.
- Row-local (two-pass with
order): streams, merges, materializes. Row weight ignored. - A registered model scores whole-model (
no_scorerwithout a scorer); save, load, ordinal, multinomial:regression-row-scores.REG_MMM_BAYESalone takes a whole-modelbound(mmm-bayes-posterior).
See
pulse_examples_search tags=[compose]- Skills:
regression-row-scores,compose-fits,regression-modeling,op-attr-reg-fitted,expression-language(coef())