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-multinomial
description: Multinomial (baseline-category) logistic regression of a categorical target on numeric predictors; one coefficient set per non-reference level, log odds against the reference. Always buffered.
kind: operator
category: REG
operator: REG_MULTINOMIAL
type: reference
applies_to: process, compose, predict
examples_tags: [regression, multinomial, buffered-pipeline]

Rides regressions[i]; no Response.Components.

Use when

Fits a model of an outcome with three or more categories (which plan, brand or channel), comparing each with a reference category.

Questions it answers:

  • Which customer traits are associated with choosing the premium or the basic plan over the standard one, holding the others fixed?
  • How does the chance of each support channel being picked change with the customer’s age?

Params

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

NameTypeDefaultDescription
targetfield(required)Categorical; dictionary order.
predictors[]field(required)≥1 numeric.
referencestring—First fitted level.
penaltyenum""l2, l1, elasticnet.
alphafloat——
l1_ratiofloat——
unpenalized[]field——
max_itersint50—
tolfloat0.00000001—
conf_levelfloat0.95—
vcovboolfalse—
covarianceobject—hc0, hc1, cluster.
exponentiateboolfalse—
marginsobject—regression-margins.
term_testsboolfalse—
weightslot weight——
multiplicityobject—Non-intercept keys.
holdoutexpr—Scores: regression-row-scores.
resampleenum—op-reg-mod-resample.
bootstrap_itersint1000—
jackknife_groupsint——
jackknife_byfield——
rng_seedint——
selectionenum—op-reg-mod-selection.
criterionenum—aic, bic.
orderobject——
savestring—Model file.
namestring——

Inputs

target: a categorical_* field (derived: requires: categorical_target). A null drops the row.

Output

reference, categories; coefficients / std_errors / p_values (Wald z) / ci_lower / ci_upper keyed "<level>:<term>" per non-reference level; deviance, null_deviance, pseudo_r2, two_log_lik, aic. exponentiate: exponentiated (e^β, e^β·SE, e^CI). term_tests: term_tests, per predictor, df K−1: wald_*, lr_* (vs the refit without it).

Reading the output

  • coefficients.*: Keyed <category>:<term>: the change in the log odds of that category against the reference category for a one-unit increase in the term’s predictor, holding the other predictors fixed; <category>:(intercept) is that log odds when every predictor is 0.
  • std_errors.*: How much the coefficient would vary from sample to sample, from the inverse of the fitted information matrix (nnet::multinom’s Hessian).
  • conf_level: The coverage ci_lower and ci_upper were built at (the request’s conf_level, 0.95 by default).

Contract

  • Types (target): categorical_*; any other scalar type is PULSE_FIELD_TYPE_UNSUPPORTED.
  • Types (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; Newton-Raphson requires multiple passes over the data.

Gotchas

  • β: ITS level’s log odds vs the reference.
  • Empty levels drop; an empty reference (reference_empty) or one level (one_category) fails alone.
  • Refused (PROCESSING_CONFIG): GLM knobs, bounds, a prior, solver, intercept: false, collinearity; term_tests beside a modifier, margins beside selection, both beside penalty.
  • penalty (glmnet ungrouped): EVERY level gets coefficients, no reference; null SE / p / CI unless resample; no vcov.
  • resample / selection keep the categories: a bootstrap draw lacking one skips, a jackknife fails (replicate_empty_level).
  • ATTR_REG_PREDICT: category → P(y = it); output: class → index in categories; scale: link → log-odds (penalized: x’β). coef() reads "<level>:<term>".
  • Probability weight: no two_log_lik / aic / lr_*.
  • compare: df (K−1)·terms; same reference.
  • Separation → PROCESSING_REGRESSION_SEPARATION.

See