bind_predictor#

superglm.bind_predictor(
family: DistributionalFamily,
name: str,
*terms: TermInput,
intercept: bool = True,
link: str | Link | None = None,
) → BoundPredictor#

Declare a predictor by parameter name, including for custom families.

Built-in family helpers are the usual entry point. Use this function when a custom family declares its parameters without helper methods.

Parameters:
familyDistributionalFamily

The same family instance that will be passed to SuperLSS.

namestr

A name from family.parameters. This is also the name used in model results and offsets.

*termsstr or BoundTerm or BoundInteraction

Numeric column names or declarations made by the term helpers. Supply no terms for an intercept-only predictor.

interceptbool, default=True

Include an intercept in this predictor.

linkstr or Link, optional

Override the family’s default link. The model checks compatibility with the parameter’s support.

Returns:
BoundPredictor

A declaration for one parameter. Every family parameter needs one.

Examples

The generic binder and a built-in helper declare the same parameter:

>>> from superglm import GaussianLS, bind_predictor
>>> family = GaussianLS()
>>> bind_predictor(family, "location", "age").name
'location'
>>> family.location("age").name
'location'