lmc2179 / bayesian_bootstrap

bayesian bootstrapping in python
MIT License
121 stars 17 forks source link

Implementation of weight bootstrapping #8

Closed JulianWgs closed 4 years ago

JulianWgs commented 4 years ago

Hello,

first of all: This is a great package!

Now to my question: Why is the only method of Bayesian bootstrapping resampling? Many sklearn regressor implement the weight keyword in the fit function and therefore could use Bayesian bootstrapping with weights instead of resampling. This approach should be much faster and less resource hungry, since only the size of the original training data matters.

Also I'm interested in implementing such a feature :)

Greetings!

lmc2179 commented 4 years ago

Hello! Thank you so much. :)

You are absolutely correct! The mean, var, and covar functions do this without constructing resampled data, and I agree that your approach is the right one! I've even done it myself in one-off code, but I haven't had the time to implement it properly in this package.

However, if you wanted to implement it along with some unit tests, I'd be happy to accept the PR and credit you in the README for it. I think that your proposed method should probably be the default for the BayesianBootstrapBagging class, for example.

JulianWgs commented 4 years ago

Okay, will do :)

lmc2179 commented 4 years ago

I'll review your PR soon - thanks for contributing!

JulianWgs commented 4 years ago

Why did you close this issue prematurely? This will automatically be closed, when the pull request is merged.