Home > . > showClassifiers.m

showClassifiers

PURPOSE ^

%% wts = showClassifiers(CV.msf)

SYNOPSIS ^

function wts = showClassifiers(cv)

DESCRIPTION ^

%% wts = showClassifiers(CV.msf)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function wts = showClassifiers(cv)
0002 %%% wts = showClassifiers(CV.msf)
0003 
0004 [nTasks,nTrials] = size(cv.classes);
0005 for ttrial = 1:nTrials
0006   w = cv.testResults{ttrial}{2}.weights;
0007   w = w - repmat(mean(w,2),1,nTasks);
0008   wts{ttrial} = w;
0009 end
0010 
0011 figure(1);
0012 'figure 1 has zero meaned weights'
0013 for ttrial = 1:nTrials
0014   subplot(nTrials,1,ttrial);
0015   plot(wts{ttrial});
0016   title(['Test Trial ' num2str(ttrial)]);
0017 end
0018 
0019 figure(2);
0020 'figure 2 has zero meaned weights magnitudes averaged over all n tasks'
0021 for ttrial = 1:nTrials
0022   subplot(nTrials,1,ttrial);
0023   plot(mean(abs(wts{ttrial}),2));
0024   title(['Test Trial ' num2str(ttrial)]);
0025 end
0026 
0027 figure(3);
0028 'figure 3 has zero meaned weights magnitudes averaged over all n tasks for first test trial'
0029 dm = max(abs(wts{1}),[],2);
0030 plot(dm,'k');
0031 axis tight;
0032 xlabel('Feature Index');
0033 ylabel('Max Magnitude of Linear Discriminant Weights')
0034 
0035 figure(4);
0036 ['figure 4 has zero meaned weight vars over all tasks for first' ...
0037       ' test trial']
0038 vm = var(wts{1},0,2);
0039 semilogy(vm,'k');
0040 axis tight;
0041 xlabel('Feature Index');
0042 ylabel('Variance of Linear Discriminant Weights (log scale)')
0043 
0044 figure(5);
0045 'figure 5 has zero meaned weights magnitudes averaged over all n tasks for final test trial'
0046 ' grouped by electrode'
0047 for ttrial = 1:nTrials
0048   subplot(nTrials,1,ttrial);
0049   dm = mean(abs(wts{ttrial}),2);
0050   dm = reshape(dm,6,length(dm)/6);
0051 %  plot(mean(dm,2),'o-k');
0052   plot(max(dm,[],2),'o-k');
0053   title(['Test Trial ' num2str(ttrial)]);
0054   set(gca,'XTick',1:6);
0055   set(gca,'XTickLabel',{'C3','C4','P3','P4','O1','O2'});
0056   ylabel('Max Weight Magnitude');
0057 end
0058 
0059 figure(6);
0060 'figure 6 has zero meaned weights magnitudes averaged by electrode for final test trialover all n tasks for final test trial'
0061 for ttrial = 1:nTrials
0062   subplot(nTrials,1,ttrial);
0063   mns = [];
0064   for c = 1:nTasks
0065     dm = abs(wts{ttrial}(:,c));
0066     dm = reshape(dm,6,length(dm)/6);
0067     mns = [mns max(dm,[],2)];
0068   end
0069   plot(mns,'o-k');
0070   title(['Test Trial ' num2str(ttrial)]);
0071   set(gca,'XTick',1:6);
0072   set(gca,'XTickLabel',{'C3','C4','P3','P4','O1','O2'});
0073   ylabel('Max Weight Magnitude');
0074 end
0075 
0076 figure(7);
0077 'figure 7 has zero meaned weights magnitudes maxed by electrode for first test trial'
0078 mns = [];
0079 for c = 1:nTasks
0080 dm = wts{1}(:,c);
0081 %  dm = abs(wts{1}(:,c));
0082   dm = reshape(dm,6,length(dm)/6);
0083 %  mns = [mns max(dm,[],2)];
0084 mns = [mns var(dm,[],2)];
0085 end
0086 plot(mns,'o-k');
0087 set(gca,'XTick',1:6);
0088 set(gca,'XTickLabel',{'C3','C4','P3','P4','O1','O2'});
0089 ylabel('Variance of Weight Magnitudes');
0090 xlabel('Electrode')
0091 childs = get(gca,'Children');
0092 markers = ['o','x','*','s','d'];
0093 dnames = {};
0094 for c=1:nTasks
0095   set(childs(c),'Marker',markers(c),'MarkerSize',10);
0096   dnames = {dnames{:} ['Disc for Task ' num2str(c)]};
0097 end
0098 legend(dnames);
0099

Generated on Tue 07-Feb-2006 12:02:57 by m2html © 2003