1.2. Namespace Clustering

class Clustering

Khiva Clustering class containing several clustering methods.

Public Static Functions

static Tuple<KhivaArray, KhivaArray> Khiva.Clustering.KMeans(KhivaArray arr, int k, float tolerance = 1e-10F, int maxIterations = 100)

Calculates the k-means algorithm.

[1] S.Lloyd. 1982. Least squares quantization in PCM.IEEE Transactions on Information Theory, 28, 2, Pages 129-137.

Return
Tuple with the resulting means or centroids and the resulting labels of each time series which is the closest centroid.
Parameters
  • arr: Expects an input array whose dimension zero is the length of the time series (all the same) and dimension one indicates the number of time series.
  • k: The number of means to be computed.
  • tolerance: The error tolerance to stop the computation of the centroids.
  • maxIterations: The maximum number of iterations allowed.

static Tuple<KhivaArray, KhivaArray> Khiva.Clustering.KShape(KhivaArray arr, int k, float tolerance = 1e-10F, int maxIterations = 100)

Calculates the k-shape algorithm.

[1] John Paparrizos and Luis Gravano. 2016. k-Shape: Efficient and Accurate Clustering of Time Series. SIGMOD Rec. 45, 1 (June 2016), 69-76.

Return
Tuple with the resulting means or centroids and the resulting labels of each time series which is the closest centroid.
Parameters
  • arr: Expects an input array whose dimension zero is the length of the time series (all the same) and dimension one indicates the number of time series.
  • k: The number of means to be computed.
  • tolerance: The error tolerance to stop the computation of the centroids.
  • maxIterations: The maximum number of iterations allowed.