adefazio / classifierplots

Generates a visualization of binary classifier performance as a grid of diagonstic plots with just one function call
Other
48 stars 7 forks source link

Cant't understand the qbeta function in calibration_plot #14

Open liuhongwei2018 opened 4 years ago

liuhongwei2018 commented 4 years ago

In the calibration.R, qbeta function was used to calculate true probability in the calibration_plot, such as "qbeta(c(llb=0.025, lb=0.25, y=0.5, ub=0.75, uub=0.965), 0.5+positive, 0.5+bucket_size-positive)". Sorry I can't understand that. Could you please provide some expanations or some papers. Thank you!

HuwCampbell commented 4 years ago

It should actually be 0.975 to be even on both sides... so there's a small issue there. It's using the fact that the beta function is the conjugate prior of the Bernoulli.

I believe this is sometimes called the Jeffreys interval, and it's a relatively standard way of calculating a binomial confidence interval. https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval#Wilson_score_interval--%20wikipedia