Back to models
Clusterer

TimeSeriesKShapes

MultivariatePredictOut of sample

K-shape clustering for time series, from tslearn.

Quickstart

python
from sktime.clustering.k_shapes import TimeSeriesKShapes

estimator = TimeSeriesKShapes(n_clusters: int=8, init_algorithm: str | ndarray='random', n_init: int=10, max_iter: int=300, tol: float=0.0001, verbose: bool=False, random_state: int | RandomState=None)

Parameters(7)

n_clusters: int, defaults = 8
The number of clusters to form as well as the number of centroids to generate.
init_algorithm: str or np.ndarray, defaults = ‘random’
Method for initializing cluster centers. Any of the following are valid: [‘random’]. Or a np.ndarray of shape (n_clusters, ts_size, d) and gives the initial centers.
n_init: int, defaults = 10
Number of times the k-means algorithm will be run with different centroid seeds. The final result will be the best output of n_init consecutive runs in terms of inertia.
max_iter: int, defaults = 30
Maximum number of iterations of the k-means algorithm for a single run.
tol: float, defaults = 1e-4
Relative tolerance with regards to Frobenius norm of the difference in the cluster centers of two consecutive iterations to declare convergence.
verbose: bool, defaults = False
Verbosity mode.
random_state: int or np.random.RandomState instance or None, defaults = None
Determines random number generation for centroid initialization.