Evaluate Time Series Clustering

5 views (last 30 days)
john corbett
john corbett on 24 Sep 2018
I am trying to cluster whole time series' that are similar to one another using DTW distances, linkages, and the cluster function. Is it appropriate to use Silhouette score as a way of determining how well time series' are grouped together? I have been using this to determine the number of clusters I should use and the configuration with the best silhouette score does not look like it is doing the best job upon visual inspection of the clusters.
X = data';% matrix of time series' row-individual time series, col-values for series
d = pdist(X,@(Xi,Xj) dtwdist(Xi,Xj,6,'euclidean'));
Z = linkage(d,link);
clust = [];
for i=1:10
Z = linkage(d);
clust(:,i) = cluster(Z, 'maxclust', i); %e.g. numClusters = 5
end
eva = evalclusters(X,clust,'Silhouette');
This is the function that is being used to find the DTW distances
function d = dtwdist(Xi, Xj, varargin)
[m,n] = size(Xj);
% preallocate
d = zeros(m,1);
for j=1:m
d(j) = dtw(Xi, Xj(j,:), varargin{:});
end

Answers (0)

Categories

Find more on Random Number Generation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!