metrics¶
Scoring for a fitted regressor or classifier: error, skill against a no-skill forecast,
and — for classification — how far the probabilities are from calibrated. This is what
ChimeraBoostRegressor.report and ChimeraBoostClassifier.report return.
Definitions match benchmarks/run_benchmarks.py, so a number here is comparable with
the project's own benchmark tables. For a predicted quantile grid,
see quantile_metrics instead.
Scoring for a fitted regressor or classifier.
chimeraboost.quantile_metrics does this for a predicted quantile grid; this
is the same idea for the two point estimators, so that every model in the
library can be asked how it did without wiring up sklearn by hand.
Two things it does that a bare mean_squared_error call does not:
- Skill, not just error. Every headline number is reported alongside a skill score against the no-skill forecast -- the training mean for regression, the class prior for classification. 1 is perfect, 0 is no better than ignoring every feature, negative is worse than that. An RMSE of 3.1 means nothing on its own; an R2 of 0.02 does.
- Calibration. For classification, how much a monotone recalibration
would improve the Brier score (the CORP miscalibration measure). This
library temperature-scales
predict_proba, and this is the number that says whether that worked.
Definitions match benchmarks/run_benchmarks.py exactly, so a number here is
comparable with the project's own benchmark tables.
regression_report
¶
Score point predictions: rmse, mae, r2, n.
r2 is the skill score against a constant forecast -- 1 perfect, 0 no
better than always predicting the mean, negative worse. baseline sets
which mean: pass the training targets to score against what the model
actually had available, or leave it to use y itself, which is the
conservative reading (the best constant forecast in hindsight).
Source code in chimeraboost/metrics.py
classification_report
¶
Score predicted probabilities: log_loss, brier,
brier_skill, accuracy, f1_macro, calibration_mcb, n.
brier is the multiclass form, the mean over rows of
sum_k (p_k - onehot_k)**2 -- a proper scoring rule like log loss, but
bounded, so it aggregates across datasets without an unbounded tail. Binary
uses the same K=2 sum, so both tasks share one definition.
brier_skill scores it against the class prior: 1 perfect, 0 no better
than predicting the base rates.
calibration_mcb is the CORP miscalibration measure
(Dimitriadis, Gneiting & Jordan): how much an optimal monotone
recalibration would improve the per-class Brier score. 0 means already
perfectly calibrated, higher is worse. Fitted in-sample on the scored fold,
which is the standard CORP diagnostic.
Source code in chimeraboost/metrics.py
format_report
¶
Render regression_report or classification_report as a fixed-width
text block, skill scores last so the eye lands on them.