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 – numpy ndarray of shape (M,N) of N functions with M samples
time – vector of size M describing the sample points
:param K number of clusters :param seeds indexes of cluster center functions (default = None) :param lam controls the elasticity (default = 0) :param showplot shows plots of functions (default = T) :param smooth_data smooth data using box filter (default = F) :param parallel enable parallel mode using code{link{joblib}} and
code{doParallel} package (default=F)
:param alignment whether to perform alignment (default = T) :param omethod optimization method (DP,DP2,RBFGS) :param MaxItr maximum number of iterations :param thresh cost function threshold :type f: np.ndarray :type time: np.ndarray
- 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