20.01.2015 Views

njit-etd2003-081 - New Jersey Institute of Technology

njit-etd2003-081 - New Jersey Institute of Technology

njit-etd2003-081 - New Jersey Institute of Technology

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

297<br />

The MATLAB program below performs the cluster analysis on the data set created using<br />

the principal components obtained from the PCA on the 12 different HRV parameters<br />

and actual heart rate, blood pressure and breathing (respiration) rate.<br />

function [RITrue,RISelf,EstIndex]=DoClustering(Algorithm,Data,k,TrueID,Repetitions)<br />

% DOCLUSTERING Performs cluster analysis <strong>of</strong> specified data using specified<br />

% algorithm.<br />

% [RITrue,RISelf,Index]=DOCLUSTERING(Algorithm,Data,k,TrueID,Repetitions)<br />

% where Algorithm is the name <strong>of</strong> the clustering algorithm (string),<br />

% Data is 2-d matrix, with variables as columns and records as rows,<br />

% k is number <strong>of</strong> clusters to search for,<br />

% TrueID is a vector <strong>of</strong> class labels, one for each row in "Data", ([]->not known)<br />

% and Repetitions is the number <strong>of</strong> times to repeat the algorithm (default 1).<br />

% RITrue is the (adjusted) Rand Index comparing the solution to the true labels<br />

% (where known). RISelf is the (adjusted) Rand Index between pairs <strong>of</strong> solutions<br />

% (when Repetitions > l).<br />

% Index is the estimated labels <strong>of</strong> each record.<br />

% AlgorithmList=DOCLUSTERING with no parameters returns list <strong>of</strong> all<br />

% the aglorithms available<br />

% Copyright (C) David Corney 2000 D.Corney@cs.ucl.ac.uk<br />

%If no inputs, then return list <strong>of</strong> all aglorithms used (arbitrary order).<br />

if nargin == 0<br />

RITrue={'kmeans','EM_spherical','EM_elliptical',<br />

'hier_centroid','hier_complete','hier_single',<br />

'fuzzy','random'};<br />

return<br />

end<br />

if nargin < 3<br />

error(DOCLUSTERING requires at least 3 arguments');<br />

help(mfilename)<br />

return<br />

end<br />

if nargin < 4, TrueID=[]; end %no known class labels<br />

if nargin < 5, Repetitions = 1;end %only do it once<br />

if nargin < 6, options = 0;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!