_images/logo.png

Elastic Functional Clustering#

Elastic Functional Clustering

moduleauthor:: J. Derek Tucker <jdtuck@sandia.gov>

kmeans.kmeans_align(f, time, K, seeds=None, lam=0, showplot=True, smooth_data=False, parallel=False, alignment=True, omethod='DP2', MaxItr=50, thresh=0.01)[source]#

This function clusters functions and aligns using the elastic square-root slope (srsf) framework.

Parameters:
  • f (np.ndarray) – numpy ndarray of shape (M,N) of N functions with M samples

  • time (np.ndarray) – vector of size M describing the sample points

  • K – number of clusters

  • seeds – indexes of cluster center functions (default = None)

  • lam – controls the elasticity (default = 0)

  • showplot – shows plots of functions (default = T)

  • smooth_data – smooth data using box filter (default = F)

  • parallel – enable parallel mode using code{link{joblib}} and code{doParallel} package (default=F)

  • alignment – whether to perform alignment (default = T)

  • omethod – optimization method (DP,DP2,RBFGS)

  • MaxItr – maximum number of iterations

  • thresh – cost function threshold

Return type:

dictionary

Return fn:

aligned functions - matrix (N x M) of M functions with N samples which is a list for each cluster

Return qn:

aligned SRSFs - similar structure to fn

Return q0:

original SRSFs

Return labels:

cluster labels

Return templates:

cluster center functions

Return templates_q:

cluster center SRSFs

Return gam:

warping functions - similar structure to fn

Return qun:

Cost Function