tspy.ml.clustering.kshape module

tspy.ml.clustering.kshape.fit(multi_time_series, k_clusters, num_runs, use_eigen=True, init_strategy='plusplus')

create a time-series-clustering model using the kshape clustering implementation.

Parameters
multi_time_seriesMultiTimeSeries

the input multi-time-series

k_clustersint or list

if a single int is given, will create a clustering model with the given number of cluster. If a list is given, k-shape will be performed for each k-cluster value between the first number given and the second number given, the output will be the best model based on the min sum of square distances for all centroids

num_runsint

number of runs for clustering

use_eigenbool, optional

if True, uses Eigen-Decomposition for shape extraction, otherwise uses simple averaging (default is True)

init_strategystr, optional

the initialization strategy for the seed centroids in the model. Can be one of “random”, “zero”, “plusplus” (default is “plusplus”)

Returns
TimeSeriesClusteringModel

a new time-series-clustering-model