9951 explained code solutions for 126 technologies


python-scikit-learnHow to resample with replacement


from sklearn import utils

X = [1,2,2,4,3,6,7,3,9]
Xr = utils.resample(X, n_samples=5, random_state=, replace=True)ctrl + c
from sklearn import

import module from scikit-learn

utils.resample(

resample given dataset in a consistent way

n_samples

number of samples to get for result

random_state

random seed to get repeatable results

replace=True

use resampling with replacement, this is True by default