NoPredictedMeanError#

exception superglm.NoPredictedMeanError(
message: str,
*,
positions: NDArray[int64],
n_rows: int,
link: str,
what: str = '',
advice: str = '',
value: str = 'mean',
)#

Bases: ValueError

A score was asked of weighted rows that have no predicted mean.

predict gives such a row NaN: under the inverse, inverse-squared or a negative-power link, a row whose linear predictor is at or below zero, or overflows. metrics, the cross-validation scores, the statistical tests and the other readers that score rows raise this ValueError instead of reading the row. Give those rows weight zero, leave them out, or refit with a log link (logit for a binomial).

positions are those rows’ positions among n_rows (the message names the first ten), link names the link that has no mean for them, what the score refused and value what the rows lack: "mean", or a SuperLSS parameter’s value ("value of 'mean'"). The details survive a pickle round trip, as when the error crosses a process boundary from a fold.