Biomedical Engineering Reference
In-Depth Information
4. Segment the data into a training data and a testing set.
5. Training a classifier from training data to predict the behav-
ioral outcome of testing data. Repeat at least 10 times (10
fold cross-validation) (32) .
6. Evaluate classifier performance with information theory or
ROC analysis.
7. Repeat steps 1-5 for trial-shuffled data.
Implementation of these steps is highly involved and requires
careful understanding of the methods used for preprocessing,
dimension reduction, and classification. In essence, statistical pat-
tern recognition uses neuronal data to predict a behavioral vari-
able on each trial. Classifier performance can then be quantified
by comparing classifier predictions of the behavioral variable (i.e.,
slow vs. fast RTs) with the actual behavioral variable (the RT that
the animal actually made).
Below is a brief demonstration with random data using PCA
and k-means clustering:
%make random data; 40 trials, 100 bins, 2 classes
a = rand(40, 100); b = rand(40, 100) * 1.2; % 1.2 is the
separation coeff
data = ([a; b]);
groups = [ones(1, 40) ones(1, 40) * 2]; % make a groups
vector
[u,s,v] = svd(data',0); % pca for dimension reduction
U = u(:,1:3); %only first three components
scores = data * U; % obtain scores for PCA
% Use k means to cluster groups in high dimensional
space. This is being used % as a classifier WITHOUT
cross validation, and although it is not a strong % %
classifier, it illustrates the point; any classifier
will do
[pred1, C] = kmeans(scores, length(unique(groups)));
% Plot the PC scores in dimensional space; check for clusters
g1 = find(groups==1); g2 = find(groups==2); hold on;
scatter3(scores(g1, 1), scores(g1, 2), scores(g1, 3),
'k.');
scatter3(scores(g2, 1), scores(g2, 2), scores(g2, 3),
'r.');
scatter3(C(:, 1), C(:, 2), C(:, 3), 'b+');
confusionMatrix(1,1)=length((find(pred1(g1)==1)));%
true positive
confusionMatrix(1,2)=length((find(pred1(g1)==2)));%
false positive
confusionMatrix(2,1)=length((find(pred1(g2)==1)));%
false negative
confusionMatrix(2,2)=length((find(pred1(g2)==2)));%
true negative
In the above code, random data are created. In one class, a
slight bias of 20% (represented by the factor 1.2 above) is gen-
erated. PCA is then performed for dimension reduction, and
Search WWH ::




Custom Search