hypertools.tools.
cluster
(x, cluster='KMeans', n_clusters=3, ndims=None, format_data=True)[source]¶Performs clustering analysis and returns a list of cluster labels
The data to be clustered. You can pass a single array/df or a list. If a list is passed, the arrays will be stacked and the clustering will be performed across all lists (i.e. not within each list).
Model to use to discover clusters. Support algorithms are: KMeans, MiniBatchKMeans, AgglomerativeClustering, Birch, FeatureAgglomeration, SpectralClustering and HDBSCAN (default: KMeans). Can be passed as a string, but for finer control of the model parameters, pass as a dictionary, e.g. reduce={‘model’ : ‘KMeans’, ‘params’ : {‘max_iter’ : 100}}. See scikit-learn specific model docs for details on parameters supported for each model.
Number of clusters to discover. Not required for HDBSCAN.
Whether or not to first call the format_data function (default: True).
Deprecated argument. Please use new analyze function to perform combinations of transformations
An list of cluster labels