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_repeatsindependent ensembles are fitted and all pairs of their consensus partitions are compared with the fuzzy Rand index (or anotherindex); 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
ofshape(n_samples,n_features) - n_estimators_gridsequence
ofint, default=(1, 2, 5, 10, 20) - n_repeats
int, default=5 - random_state
int,RandomStateinstanceorNone - index
callable(), default=:func:fuzzyclust.validity.fuzzy_rand_index Comparison of two membership matrices, e.g.
fuzzy_adjusted_rand_index().- **ensemble_params
Passed to
FuzzyClusterEnsemble.
- Xarray_like
- Returns:
pandas.DataFrameIndexed by
n_estimatorswith columnsmeanandstdof 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