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-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_CHISQ when the outcome and the single predictor are both categories.

Params

Flat keys (params is refused); shared: regression-spec.

NameTypeDefaultDescription
targetfield(required)Response (numeric).
predictors[]field(required)≥1 numeric.
familyenum(required)binomial, poisson, gamma, negative_binomial.
linkenum—logit/probit/cloglog; log/identity/sqrt (poisson, NB); inverse/log/identity; 1st default.
thetafloat—NB fixed θ > 0; else ML.
dispersionenumfixedNB + theta: estimated φ̂.
penaltyenum""l2, l1, elasticnet (not gamma).
alphafloat—Strength, > 0.
l1_ratiofloat—Mix, 0<r<1.
unpenalized[]field—Unshrunk.
max_itersint—IRLS cap.
tolfloat—Tolerance.
resampleenum—bootstrap, jackknife.
bootstrap_itersint1000Resample.
jackknife_groupsint—Resample.
jackknife_byfield—Resample.
rng_seedint—Resample.
selectionenum—backward, forward, stepwise.
criterionenum—aic, bic.
conf_levelfloat0.95CI level.
vcovboolfalseAdds vcov + correlation.
covarianceobject—Robust SEs.
marginsobject—AME / MEM (regression-margins).
collinearityobject—VIFs (regression-collinearity).
weightslot weight—Prior weights.
multiplicityobject—p-values join a family.
holdoutexpr—Held-out rows → holdout.
savestring—Writes a model file.
orderobject—Row order.
namestring—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 is PULSE_FIELD_TYPE_UNSUPPORTED.
  • Weight: weighted under frequency and probability weights.
  • Multiplicity: its own multiplicity block (an inherited one never reaches it) adds per-coefficient p_adjusted and significant_adjusted beside the raw p; families request (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): add penalty: l2 or drop it.
  • Other non-convergence → PROCESSING_REGRESSION_NO_CONVERGE: raise max_iters; NB theta_unbounded: fit poisson. Another family’s link → PROCESSING_REGRESSION_INVALID_LINK.
  • Poisson fixes φ = 1 (overdispersion: too-small SEs); fit negative_binomial or a robust covariance.
  • Collinear / constant → PROCESSING_REGRESSION_RANK_DEFICIENT.

See