11.13.1. astroML.resample.bootstrap

astroML.resample.bootstrap(data, n_bootstraps, user_statistic, kwargs=None, pass_indices=False, random_state=None)[source]

Compute bootstraped statistics of a dataset.


An n-dimensional data array of size n_samples by n_attributes


the number of bootstrap samples to compute. Note that internally, two arrays of size (n_bootstraps, n_samples) will be allocated. For very large numbers of bootstraps, this can cause memory issues.


The statistic to be computed. This should take an array of data of size (n_bootstraps, n_samples) and return the row-wise statistics of the data.

kwargsdictionary (optional)

A dictionary of keyword arguments to be passed to the user_statistic function.

pass_indicesboolean (optional)

if True, then the indices of the points rather than the points themselves are passed to user_statistic

random_state: RandomState or an int seed (0 by default)

A random number generator instance


the bootstrapped distribution of statistics (length = n_bootstraps)