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,
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 isNone, one number, or one number per row. A truncated row contributes its density divided byP(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.
Trueor"right"reads a row as “strictly greater than this”, such as a claim paid at its policy limit, and"left"as “at most this”;Falseand"none"leave a row complete. A missing entry (None, NaN orpd.NA) is refused rather than read as complete. Pass one flag per row, for examplecensored=loss > limitwithy=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_remlEstimate 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
truncationorcensoredthe fit estimates the parent law of the uncut response, sopredictand the distribution functions describe that law, not the law within the bounds. All eleven built-in scalar families support these observations;DirichletLSSaccepts complete compositions only.