SplineCategorical#

class superglm.SplineCategorical(spline_name: str, cat_name: str)#

Bases: object

Varying-coefficient interaction: spline curve per categorical level.

For each non-base level of the categorical, produces one group of K B-spline columns masked by the level indicator. The base level’s effect is absorbed into the main spline term.

build_discrete(
x_spline: NDArray,
x_cat: NDArray,
parent_specs: dict,
n_bins: int,
sample_weight: NDArray | None = None,
) → list[GroupInfo]#

Build spline-by-category groups from compressed spline support.

score(
x_spline: NDArray,
x_cat: NDArray,
beta: NDArray,
) → NDArray#

Score the interaction directly from its public runtime blocks.