-
Notifications
You must be signed in to change notification settings - Fork 15
/
mdmfilter.m
26 lines (19 loc) · 842 Bytes
/
mdmfilter.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function Ytest = mdmfilter(Xtest,Xtrain,Ytrain,Nfilters)
% training data
% ---------------------------------------------------------------------
% train filters on training data
[V,P] = trainfilter(Xtrain,Ytrain,Nfilters);
% apply filters on training data
X2 = applyfilters(Xtrain,V);
% estimates special for covariance matrices
COVtr = covariances_p300(X2,P);
% test data
% ---------------------------------------------------------------------
% apply filters on test data
X2 = applyfilters(Xtest,V);
% estimates special form covariance matrices
COVte = covariances_p300(X2,P);
% Classification
% ---------------------------------------------------------------------
% MDM classification
Ytest = mdm(COVte,COVtr,Ytrain,'riemann','riemann');