name: op-reg-glm
description: Generalized linear model via IRLS; supports binomial (logistic), poisson, gamma and negative binomial (NB2, theta estimated) families with family-specific link functions. Always buffered.
kind: operator
category: REG
operator: REG_GLM
type: reference
applies_to: process, compose, predict
examples_tags: [regression, glm, logistic, buffered-pipeline]
Fits ride regressions[i]; no Response.Components.
Use when
Fits a generalized linear model: logistic for yes/no outcomes, Poisson or negative binomial for counts, gamma for positive skewed amounts.
Questions it answers:
- Which customer traits are associated with the chance of churning, holding the others fixed?
- How does the expected number of support tickets change with account size?
Use something else:
TEST_CHISQwhen the outcome and the single predictor are both categories.
Params
Flat keys (params is refused); shared: regression-spec.
| Name | Type | Default | Description |
|---|---|---|---|
target | field | (required) | Response (numeric). |
predictors | []field | (required) | ≥1 numeric. |
family | enum | (required) | binomial, poisson, gamma, negative_binomial. |
link | enum | — | logit/probit/cloglog; log/identity/sqrt (poisson, NB); inverse/log/identity; 1st default. |
theta | float | — | NB fixed θ > 0; else ML. |
dispersion | enum | fixed | NB + theta: estimated φ̂. |
penalty | enum | "" | l2, l1, elasticnet (not gamma). |
alpha | float | — | Strength, > 0. |
l1_ratio | float | — | Mix, 0<r<1. |
unpenalized | []field | — | Unshrunk. |
max_iters | int | — | IRLS cap. |
tol | float | — | 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 level. |
vcov | bool | false | Adds vcov + correlation. |
covariance | object | — | Robust SEs. |
margins | object | — | AME / MEM (regression-margins). |
collinearity | object | — | VIFs (regression-collinearity). |
weight | slot weight | — | Prior weights. |
multiplicity | object | — | p-values join a family. |
holdout | expr | — | Held-out rows → holdout. |
save | string | — | Writes a model file. |
order | object | — | Row order. |
name | string | — | Result / model name. |
Inputs
See ## Contract; binomial target {0,1} or packed_bool; null / NaN / ±Inf drops the row.
Output
coefficients ((intercept) + βs, link scale), std_errors, p_values, ci_lower / ci_upper — Wald z, no df, or t on df (gamma; regression-spec); conf_level, deviance, null_deviance, pseudo_r2, converged_iters, n_obs, two_log_lik, aic; family / link echoed. NB: theta, theta_std_err (null: l1/enet).
Reading the output
coefficients.*: The change in the linear predictor, on the link scale, for a one-unit increase in this predictor, holding the other predictors fixed: log-odds for binomial (logit link), the log of the expected count for Poisson (log link), the inverse of the expected value for gamma (inverse link), the log of the expected count for negative_binomial (log link).p_values.*: a p-value. Below alpha (0.05 unless the request sets another) the result is called significant; that is not the same as important, so read the effect size for how big it is.
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: buffered only. Always buffered; IRLS requires multiple passes over the data.
Gotchas
- Binomial separation →
PROCESSING_REGRESSION_SEPARATION(slot fails alone): addpenalty: l2or drop it. - Other non-convergence →
PROCESSING_REGRESSION_NO_CONVERGE: raisemax_iters; NBtheta_unbounded: fit poisson. Another family’s link →PROCESSING_REGRESSION_INVALID_LINK. - Poisson fixes φ = 1 (overdispersion: too-small SEs); fit
negative_binomialor a robustcovariance. - Collinear / constant →
PROCESSING_REGRESSION_RANK_DEFICIENT.
See
pulse_examples_search tags=[glm]- Skills:
regression-spec,regression-modeling,regression-margins,regression-inference,op-reg-mod-resample,op-reg-mod-selection