Skip to content

Commit

Permalink
ENH smaller confidence intervals in plot_reliability_diagram (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
lorentzenchr authored Nov 27, 2024
1 parent 1f194a3 commit 3e9a8bd
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 22 deletions.
12 changes: 6 additions & 6 deletions docs/examples/classification.ipynb

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions docs/examples/quantile_regression.ipynb

Large diffs are not rendered by default.

23 changes: 18 additions & 5 deletions docs/examples/regression_on_workers_compensation.ipynb

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/model_diagnostics/calibration/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,11 @@ def iso_statistic(y_obs, y_pred, weights=None, x_values=None):

# We make the interval conservatively monotone increasing by applying
# np.maximum.accumulate etc.
lower = -np.minimum.accumulate(-boot.confidence_interval.low)
upper = np.maximum.accumulate(boot.confidence_interval.high)
# Conservative here means smaller intervals such that it is more likely
# for the prediction to be out of the intervals leading to the conclusion
# of "not auto-calibrated".
lower = np.maximum.accumulate(boot.confidence_interval.low)
upper = np.minimum.accumulate(boot.confidence_interval.high[::-1])[::-1]
if diagram_type == "bias":
lower = iso.X_thresholds_ - lower
upper = iso.X_thresholds_ - upper
Expand Down

0 comments on commit 3e9a8bd

Please sign in to comment.