bind_levels#
- SuperGLM.bind_levels( ) SuperGLM#
Bind categorical level universes from the outermost frame.
Runs the same pre-pass
cross_validateapplies to its own input: for every categorical-family feature, resolve the level universe and any unresolvedmost_exposedbase from X, and store the result on this model’s configuration. Call it with the FULL frame before any train/val/test carve; every subsequent fit on any slice then shares one universe, and a level living only in the holdout is a pinned known level rather than a predict-time error.Explicit
levels=on a term always wins, and a frame value outside such a declared universe fails here rather than at fit. Re-calling replaces the stored bindings. Returnsselfso construction chains:model = SuperGLM(...).bind_levels(df).