fuzzyclust.validity.scan_n_clusters#

fuzzyclust.validity.scan_n_clusters(estimator, X, n_clusters_range=range(2, 11), indices=None)[source]#

Fit the estimator for several numbers of clusters and tabulate validity indices.

Parameters:
estimatorfitted or unfitted fuzzyclust estimator

Cloned and refitted for every value of n_clusters.

Xarray_like of shape (n_samples, n_features)
n_clusters_rangeiterable of int, default=range(2, 11)
indicesiterable of str, optional
Returns:
pandas.DataFrame

Indexed by n_clusters with one column per index.

Examples

>>> from fuzzyclust.cluster import FCM
>>> from fuzzyclust.datasets import make_fuzzy_blobs
>>> from fuzzyclust.validity import scan_n_clusters
>>> X, _ = make_fuzzy_blobs(random_state=0)
>>> table = scan_n_clusters(FCM(random_state=0), X, range(2, 6), indices=["PC", "XB"])
>>> list(table.columns)
['PC', 'XB']

Examples using fuzzyclust.validity.scan_n_clusters#

Choosing the number of clusters with validity indices

Choosing the number of clusters with validity indices

Feature scaling on real data: the motorcycle data set

Feature scaling on real data: the motorcycle data set

Three routes to the number of clusters: merging, validity scan, and stability

Three routes to the number of clusters: merging, validity scan, and stability

Number of clusters: volume-based validity and fuzzy cluster similarity

Number of clusters: volume-based validity and fuzzy cluster similarity