re#
- superglm.re(
- column: Hashable,
- *,
- levels: Any = None,
- unseen: Literal['population', 'error'] = 'population',
- missing: Literal['error'] = 'error',
- lambda_policy: LambdaPolicy | None = None,
- nested_in: Hashable | None = None,
Declare a random effect with a coefficient for every group level.
For example,
re("broker")lets broker effects shrink toward the population value. Usefit_remlto estimate the variance component. This encoding does not drop a reference level.- Parameters:
- columnhashable
Label of the grouping column, usually its name.
- levelssequence, data column or categorical dtype, optional
Declare the allowed levels, including levels with no training rows.
- unseen{“population”, “error”}, default=”population”
Prediction policy for unknown levels.
"population"gives the random effect a contribution of zero on the predictor’s link scale.- missing{“error”}, default=”error”
Missing group labels raise an error.
- lambda_policyLambdaPolicy, optional
Set the policy for the random effect’s smoothing penalty.
- nested_instr, optional
Name of another random effect in the same predictor that this one is nested in, such as a region within a country. Each training row is checked against it.
- Returns:
- BoundTerm
A random-effect declaration for the named column.
See also
RandomEffectLevel handling and variance-component estimation.
catCategorical encoding relative to a reference level.