metrics#
- SuperGLM.metrics( ) ModelMetrics#
Compute comprehensive diagnostics for the fitted model.
The deviance, likelihoods, Pearson statistic and
residuals()are computed from the model’s predictions onX, the valuespredictreturns. They do not depend on object identity: equal copies of the training data and a saved and reloaded model give the same values as the objects the model was fitted on. Leverage-based diagnostics do depend on it. On the fit’s own objects,leverage, the standardized residuals and Cook’s distance read the fit’s own geometry; see theModelMetricsnotes.summary()instead reports the fit’s own statistics from its fitting design. On adiscrete=Truefit that design is the binned one, so the two differ slightly on the training data.- Raises:
- NoPredictedMeanError
A
ValueErrornaming the rows of positive weight thatpredict()gives no mean (NaN), such as rows past an inverse link’seta = 0: no deviance or likelihood exists for them. Give those rows weight zero or leave them out; a zero-weight row is scored as before, its residuals and Cook’s distance read NaN, andetareports its raw linear predictor.