name: op-reg-ols
description: Ordinary least squares with optional l1/l2/elasticnet penalty; covers simple, multiple, ridge, lasso, and elastic-net regression over streaming sufficient statistics.
kind: operator
category: REG
operator: REG_OLS
type: reference
applies_to: process, compose, predict
examples_tags: [regression, ols, streaming-friendly]
Fits ride regressions[i]; no Response.Components.
Use when
Fits a straight-line model that predicts a numeric outcome from one or more numeric predictors, by least squares.
Questions it answers:
- Which of price, discount and season are associated with weekly sales, holding the others fixed?
- How much does predicted order value change per extra visit, with the other predictors held fixed?
Use something else:
REG_GLMwhen the outcome is yes/no (0/1) or a count.
Params
Flat keys (params is refused); shared: regression-spec.
| Name | Type | Default | Description |
|---|---|---|---|
target | field | (required) | Response (numeric). |
predictors | []field | (required) | ≥1 numeric. |
penalty | enum | "" | l1, l2, elasticnet. |
alpha | float | — | Strength, > 0. |
l1_ratio | float | — | Mix, 0<r<1. |
unpenalized | []field | — | Left unshrunk. |
bounds | object | — | {nonnegative: [...]}: slopes ≥ 0. |
intercept | bool | true | false: no intercept. |
solver | enum | qr | Or normal. |
max_iters | int | — | Penalized cap. |
tol | float | — | Penalized tolerance. |
resample | enum | — | bootstrap, jackknife. |
bootstrap_iters | int | 1000 | Resample. |
jackknife_groups | int | — | Resample. |
jackknife_by | field | — | Resample. |
rng_seed | int | — | Resample. |
selection | enum | — | backward, forward, stepwise. |
criterion | enum | — | aic, bic. |
conf_level | float | 0.95 | CI coverage. |
vcov | bool | false | Adds vcov + correlation. |
covariance | object | — | Robust SEs. |
margins | object | — | Effects = βs (regression-margins). |
collinearity | object | — | VIFs (regression-collinearity). |
weight | slot weight | — | null opts out; WLS. |
multiplicity | object | — | p-values join a family; adds p_adjusted. |
holdout | expr | — | Held-out rows → holdout. |
save | string | — | Writes a model file. |
order | object | — | Row order. |
name | string | — | Result / model name. |
Inputs
See ## Contract; null / NaN / ±Inf drops the row.
Output
coefficients["(intercept)"] + per-predictor βs; std_errors, p_values (Student-t); ci_lower / ci_upper, df, conf_level; r2, adj_r2, residual_std_err, two_log_lik / aic, n_obs (+ weighted sum_weights). Robust covariance adds a covariance echo.
Reading the output
coefficients.*: The difference in the outcome’s expected value between rows one unit apart on this predictor, holding the other predictors fixed, in outcome units per predictor unit (an association, not the effect of changing it).std_errors.*: How much the coefficient would vary from sample to sample; smaller means a more precise estimate. It is the classic standard error, which assumes residuals of constant spread, unless the request’s covariance names a robust one.n_obs: Rows used in the fit, after rows with a null target or predictor were dropped.
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. - Multiplicity: its own
multiplicityblock (an inherited one never reaches it) adds per-coefficientp_adjustedandsignificant_adjustedbeside the raw p; familiesrequest(default),compose(inside Compose). - Streaming: streamable.
Gotchas
l1/elasticnet: null SE / p / CI +PULSE_ADVISORY_PENALIZED_INFERENCE_UNDEFINED; useresample. The penalty reads raw units (regression-spec).unpenalized/boundsmisuse →PROCESSING_CONFIG; a binding bound:regression-model-options.vcovunderl1/elasticnet, or a robustcovariance(buffered) besidepenalty/resample/selection/bounds→PROCESSING_REGRESSION_VCOV_UNSUPPORTED.- Weighted
resample: bootstrap/selection→PULSE_WEIGHT_UNSUPPORTED. - Collinear →
PROCESSING_REGRESSION_RANK_DEFICIENT/SINGULAR_GRAM: drop one, orl2. - Per-row diagnostics:
ATTR_REG_*.
See
pulse_examples_search tags=[ols]- Skills:
regression-spec,regression-modeling,regression-margins,regression-model-options,regression-inference,regression-panel-covariance,op-reg-mod-resample,op-reg-mod-selection