fuzzyclust.ensemble.stability_curve#

fuzzyclust.ensemble.stability_curve(X, n_estimators_grid=(1, 2, 5, 10, 20), n_repeats=5, random_state=None, index=<function fuzzy_rand_index>, **ensemble_params)[source]#

Reproducibility of the consensus partition as the library grows.

For every library size, n_repeats independent ensembles are fitted and all pairs of their consensus partitions are compared with the fuzzy Rand index (or another index); the mean and standard deviation of the agreement is the stability of the consensus at that size. A single run (n_estimators=1) gives the stability of the base clusterer itself.

Parameters:
Xarray_like of shape (n_samples, n_features)
n_estimators_gridsequence of int, default=(1, 2, 5, 10, 20)
n_repeatsint, default=5
random_stateint, RandomState instance or None
indexcallable(), default=:func:fuzzyclust.validity.fuzzy_rand_index

Comparison of two membership matrices, e.g. fuzzy_adjusted_rand_index().

**ensemble_params

Passed to FuzzyClusterEnsemble.

Returns:
pandas.DataFrame

Indexed by n_estimators with columns mean and std of the pairwise agreement (index) between repeats.

Examples

>>> from fuzzyclust.ensemble import stability_curve
>>> from fuzzyclust.datasets import make_fuzzy_blobs
>>> X, _ = make_fuzzy_blobs(n_samples_per_cluster=30, random_state=0)
>>> table = stability_curve(X, n_estimators_grid=(1, 3), n_repeats=2, n_clusters=3, random_state=0)
>>> list(table.columns), list(table.index)
(['mean', 'std'], [1, 3])

Examples using fuzzyclust.ensemble.stability_curve#

Consensus of soft clusterings: a library beats a single run

Consensus of soft clusterings: a library beats a single run