Bayesian histograms for rare event classification(dionhaefner.github.io) |
Bayesian histograms for rare event classification(dionhaefner.github.io) |
library(mgcv)
gam(y ~ s(x), data, family = binomial)
to do a wiggly logistic regression, and avoid the binning issue entirely.You can do it Bayesianly if you like, but I don't see why we should discretize the data into buckets.
And what am I supposed to take away from the normalized histogram?
A truly Bayesian approach would require specifying a likelihood function for the data based on the choice of bins and turning this into a posterior distribution on the choice (and number) of bins.
Calculating the maximum likelihood estimate for the simplest such likelihood function (samples within a bin are uniform + the number of bins is geometrically distributed) can be done with a vaguely similar algorithm, but simply merging adjacent bins greedily is almost certainly biasing the result right now.
Yes the pruning can be done with a frequentist method too. Yes you can come up with smarter / more statistically sound ways to construct these binnings. Do they work on >1e9 data points?
[1] https://www.researchgate.net/publication/47278398_Optional_P...