name: op-reg-mod-selection
description: Spec-level subset-selection modifier (forward / backward / stepwise) that composes with an OLS, GLM, ordinal or multinomial fit; drives a greedy search over predictors against an information criterion. Non-empty value forces the buffered path.
kind: operator
category: REG
operator: REG_SELECTION
type: reference
applies_to: process, compose, predict
examples_tags: [regression, selection, stepwise, buffered-pipeline]
Regression operators emit coefficient + diagnostics; no Response.Components. This modifier shrinks the active predictor set in regressions[i].selected_features and drops non-selected entries from coefficients / std_errors.
Params
Top-level selection on the regression spec plus its required criterion companion. A wrapper, not a fit: the engine refits the host model against candidate subsets and keeps the lowest-criterion winner.
| Name | Type | Default | Description |
|---|---|---|---|
selection | enum | — | forward (intercept-only, add best each step), backward (full, drop best each step), stepwise (bidirectional until no move improves); absent / "" = off. |
criterion | enum | — | aic or bic; required when selection is set (SERVICE_VALIDATION). |
Inputs
Inherits target / predictors from the host spec. No additional field inputs.
| Host | Accepted? |
|---|---|
REG_OLS | yes; with a penalty, predict warns PROCESSING_REGRESSION_REGULARIZED_SELECTION |
REG_GLM | yes; with a penalty, predict warns as above |
REG_BAYES_LINEAR | refused, PROCESSING_CONFIG (predict too) |
REG_ORDINAL | yes — candidates keep the first fit’s levels; k counts thresholds (stepAIC on polr) |
REG_MULTINOMIAL | yes — a predictor enters / leaves for every category, k = (K−1)·(terms + 1) (K·(terms + 1) under penalty, which predict warns as above); candidates keep the first fit’s categories (stepAIC on multinom) |
Output
selected_features— the chosen predictors in fit order; absent when none is kept.coefficientsfor selected predictors plus(intercept)only. Absent ≠ zero — non-selected predictors were dropped entirely.std_errors/p_valuesfor selected predictors only.selection/criterionecho back.
Gotchas
- Any non-empty
selectionforces the buffered path; predict reports it. criterionmissing whenselectionset →SERVICE_VALIDATION.- Scores = R’s
AIC()/BIC(): OLS Gaussian likelihood; binomial / poisson deviance + 2k (+ log(n)·k); gamma its likelihood at φ = deviance / n, φ counted (k + 1), so it walks Rstep()’s path where φ = 1 would not; NB each candidate’s likelihood at its own θ̂ (θ counted;stepAIConglm.nb).step()ranks moves by deviance / φ̂ of the current fit, then refits — rare ties can part. - Worst-case
O(p²)fits (stepwise); on wide tables preferforward. - Composes with
resample— the resample wraps the selected-feature fit. - Selection inflates type-I error on retained predictors; treat the model as exploratory.
See
pulse_examples_search tags=[stepwise]- Skills:
regression-modeling,op-reg-ols,op-reg-glm,op-reg-mod-resample