Skip to content
Source code for a paper using Mahalanobis distances for time series classification.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.txt
TSValidate.m
cov_shrink.m
data.mat
dtw.m
dtw_matrix.m
generatedata.py
ishikawa.m
looper.m
looper_lmnn2.m
looper_synth.m
minkowski_matrix.m
synthdatasets.py
znorm.m

README.txt

HOWTO for reproducing the results in the paper
Zoltan Prekopcsak, Daniel Lemire: Time Series Classification by Class-Specific Mahalanobis Distance Measures

Preliminaries:
- the Keogh benchmark[1] should be placed in a directory called 'dataset'
- the mLMNN package[2] should be in the Matlab path (File/Set path)
- the data.mat file has to be loaded to Matlab

The results in Table 2 can be reproduced by the following commands column by column:
looper(data,'gmahalanobis',Inf,'euc',1)
looper(data,'mahalanobis',Inf,'euc',1)
looper(data,'gmahalanobis',0,'euc',1)
looper(data,'mahalanobis',0,'euc',1)

The results in Table 3 can be reproduced by the following commands column by column:
looper(data,'ones',0,'euc',1)
looper(data,'ones',0,'dtw',1)
looper(data,'mahalanobis',Inf,'euc',1)
looper(data,'mahalanobis',0,'euc',1)
looper_lmnn2(data(2:17),'global',1)

For Figure 3, first the synthetic data needs to be generated by calling 'python generatedata.py'.
Then e.g. the CC results can be reproduced by the following command:
looper_synth('CC',[10 20 50 100 200 500 1000],'ones',0,'euc',1)
looper_synth('CC',[10 20 50 100 200 500 1000],'mahalanobis',0,'euc',1)
This calculates results for all 10 random sets of all training sizes,
and we have presented the average of these runs on Figure 3.
Results for Waveform and KEOGHCBF can be obtained the same way.

[1] http://www.cs.ucr.edu/~eamonn/time_series_data/
[2] http://www.cse.wustl.edu/~kilian/Downloads/LMNN.html
You can’t perform that action at this time.