fit#

SuperLSS.fit(
X: object | EagerFrame,
y: NDArray,
sample_weight: NDArray | None = None,
*,
lambdas: Mapping[str, float] | None = None,
max_inner_iter: int = 100,
inner_tol: float = 1e-07,
retain_rows: bool = True,
truncation: tuple[object, object] | None = None,
censored: ArrayLike | None = None,
) → SuperLSS#

Fit coefficients while holding smoothing parameters fixed.

Parameters:
XDataFrame or EagerFrame

Input columns named in the predictor declarations.

yarray-like of shape (n_observations,)

Response values in the family’s support, in the same row order as X.

sample_weightarray-like, optional

One weight per row, interpreted using weight_semantics.

lambdasmapping of str to float, optional

Smoothing strengths keyed by fully qualified penalty names, such as "location:age#wiggle" for a Gaussian smooth.

max_inner_iterint, default=100

Maximum number of coefficient iterations.

inner_tolfloat, default=1e-7

Coefficient convergence tolerance.

retain_rowsbool, default=True

Retain fitted row arrays for training diagnostics.

truncation(lower, upper), optional

Bounds outside which a row could not have been recorded, such as a splice body kept at or below a threshold, (None, u), or losses reported above a deductible, (d, None). Each side is None, one number, or one number per row. A truncated row contributes its density divided by P(lower < Y <= upper).

censoredbool, label, or array-like of shape (n_observations,), optional

Which rows were censored, and on which side; the response of a censored row is the limit it was censored at. True or "right" reads a row as “strictly greater than this”, such as a claim paid at its policy limit, and "left" as “at most this”; False and "none" leave a row complete. A missing entry (None, NaN or pd.NA) is refused rather than read as complete. Pass one flag per row, for example censored=loss > limit with y=np.minimum(loss, limit), or one value for every row. A row is censored only when flagged, never because its response equals a limit.

Returns:
SuperLSS

This model, with its fitted state replaced by the new fit.

See also

fit_reml

Estimate smoothing parameters as part of the fit.

Notes

Declare fixed link-scale additions with offset= on each family predictor helper. Sources are resolved on these input rows, before zero-weight rows are omitted and retained values are validated.

With truncation or censored the fit estimates the parent law of the uncut response, so predict and the distribution functions describe that law, not the law within the bounds. All eleven built-in scalar families support these observations; DirichletLSS accepts complete compositions only.