samedi 25 octobre 2014

Labeling in timeseries data in matlab?


Vote count:

0




i had an array distarray[] of 35*1 which results from the distance computation of x time series(of a sample) of one user with the x time series of 35 instances. In the distarray[], the first 7 values results from the camparison with UserA, next 8 values in the sequence results from comparison with UserB, next 10 belongs to UserC & the last 10 belongs to UserD (7+8+10+10=35).


i want to apply some classifier on these results.prior to this, i want to label the values in a way that values that results from the comparison with one user have one label(e.g. in this case, since first 7 computations are of UserA will be labeled as 'UA', Similarly next 8 values will be labeled as 'UB', next 10 will be labeled as 'UC' and the last 10 will be labeled as 'UD'). In the end, if my distarray[] have values like (distarray = [120,42,25,50,95,47,32,.....252]), if apply some sort function on this list, i want the labels also be sorted accordingly.


my code upto distance computation is:



QueryFileDir = 'dirpath';
QueryFile = dir( fullfile(QueryFileDir,'QueryFileName') );
QueryFile = {QueryFile.name};
TrainingSampleDir= 'dirpath';
TrainingFiles = dir( fullfile(TrainingSampleDir,'*.SomeFileExtension') );
TrainingFiles = {TrainingFiles.name};
distarray = [];
resultingdist = [];
for i=1:length(QueryFile)
queryfilename = fullfile(QueryFileDir,QueryFile{i});
queryfile = dlmread(queryfilename, '', 2,0);
xtimeseriesq=queryfile(:,1); %assigning x timeseries of query sample to c1
for j=i+1:length(TrainingFiles)
trainfilenames = fullfile(TrainingSampleDir,TrainingFiles{j});
trainfiles = dlmread(trainfilenames, '', 2,0);
xtimeseriest=trainfiles(:,1);%assigning x timeseries of training samples to d1
resultingdist = dtw(xtimeseriesq,xtimeseriest); % distance computation using x-timeseries of query sample with all training samples
distarray = [distarray; resultingdist]; %resultant distance array
end
end


asked 39 secs ago







Labeling in timeseries data in matlab?

Aucun commentaire:

Enregistrer un commentaire