hypertools.cluster

hypertools.cluster(*args, **kwargs)[source]

Performs clustering analysis and returns a list of cluster labels

Parameters:

x : A Numpy array, Pandas Dataframe or list of arrays/dfs

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).

cluster : str or dict

Model to use to discover clusters. Support algorithms are: KMeans, MiniBatchKMeans, AgglomerativeClustering, Birch, FeatureAgglomeration, SpectralClustering (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.

n_clusters : int

Number of clusters to discover

Returns:

cluster_labels : list

An list of cluster labels