term#

superglm.term(
column: Hashable,
spec: FeatureSpec,
) → BoundTerm#

Attach an existing feature specification to an input column.

Use this for specifications without a shorthand, such as Polynomial, or to reuse a configured specification. The declaration owns a copy; building the model’s design happens during fitting.

Parameters:
columnhashable

Label of a column in the fit and prediction frames: a string, or any other label a features= key may be, such as an integer.

specFeatureSpec

A main-effect specification. Use interaction for interactions.

Returns:
BoundTerm

A declaration accepted by family predictor helpers.

Examples

>>> from superglm import Numeric, term
>>> density = term("density", Numeric())
>>> density.column
'density'