Namespace Clustering

namespace clustering

Functions

void kMeans(const af::array &tss, int k, af::array &centroids, af::array &labels, float tolerance = 0.0000000001, 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.

Parameters
  • tss: 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.
  • centroids: The resulting means or centroids.
  • labels: The resulting labels of each time series which is the closest centroid.
  • tolerance: The error tolerance to stop the computation of the centroids.
  • maxIterations: The maximum number of iterations allowed.

void kShape(const af::array &tss, int k, af::array &centroids, af::array &labels, float tolerance = 0.0000000001, 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.

Parameters
  • tss: 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.
  • centroids: The resulting means or centroids.
  • labels: The resulting labels of each time series which is the closest centroid.
  • tolerance: The error tolerance to stop the computation of the centroids.
  • maxIterations: The maximum number of iterations allowed.