oasis.stratification.stratify_by_features

oasis.stratification.stratify_by_features(features, n_strata, **kwargs)

Stratify by clustering the items in feature space

Parameters
featuresarray-like, shape=(n_items,n_features)

feature matrix for the pool, where rows correspond to items and columns correspond to features.

n_strataint

number of strata to create.

**kwargs :

passed to sklearn.cluster.KMeans

Returns
Strata instance