trajminer.clustering.AgglomerativeClustering

class trajminer.clustering.AgglomerativeClustering(n_clusters, linkage='ward', measure='precomputed', n_jobs=1)

Hierarchical Agglomerative Clustering.

n_clustersint

The number of clusters to group trajectories into.

linkagestr (default=’ward’)

The linkage method to use. Must be one of {‘ward’, complete’, ‘average’}.

measureSimilarityMeasure object or str (default=’precomputed’)

The similarity measure to use for computing similarities (see trajminer.similarity) or the string ‘precomputed’.

n_jobsint (default=1)

The number of parallel jobs.

__init__(n_clusters, linkage='ward', measure='precomputed', n_jobs=1)

Initialize self. See help(type(self)) for accurate signature.

fit_predict(X)

Fits and returns the predictions for the given test data.

Xarray-like, shape (n_samples, max_length, n_features)

Input data. If measure == ‘precomputed’, then X is a distance matrix with shape (n_samples, n_samples).

predictionsarray-like, shape (n_samples)

Assigned cluster for each input sample.