scikit-learn/scikit-learn — pull request #1454 by erg (2012-12-09 01:15:42+00:00)
Title: ENH: Add resample to preprocessing.

There have been several requests lately for class rebalancing using under/oversampling. This utility function addresses most of the use cases I can think of for sampling with replacement from a dataset.

One thing it does not do is to sample without replacement before sampling with replacement because it changes the code substantially and there is no efficient version of ``random.sample`` as per https://github.com/scikit-learn/scikit-learn/pull/1438#issuecomment-11162893. I could add that feature eventually.