Ignore:
Timestamp:
Jan 14, 2010, 4:14:48 PM (14 years ago)
Author:
(none)
Message:

PPPP - ica

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proiecte/PPPP/ica/nnClassFn.m

    r94 r138  
    1717
    1818
    19 function [testPerf,rankmat,rank] = nnclassFn(train,test,trainClass,answer);
     19function [testPerf] = nnclassFn(train,test,trainClass,answer);
    2020
    2121numTest = size(test,2);
     
    2929[Sdist,nearest] = sort(dists'); %cols of Sdist are distances in ascend order
    3030        %1st row of nearest is index of 1st closest training example
     31
     32disp(Sdist)
    3133
    3234%Create vector with nearest example, and vector with class label.
     
    4345
    4446%get rank = %correct in top N:
    45 cumtestPerf=0;
    46 for i = 1:3
    47         rankmat(:,i) = trainClass(nearest(i,:)');
    48         correcti = find( (rankmat(:,i) - answer == 0));
    49         cumtestPerf = cumtestPerf + size(correcti,1) / size(answer,1);
    50         rank(i) = cumtestPerf;
    51 end
     47%cumtestPerf=0;
     48%for i = 1
     49%        rankmat(:,i) = trainClass(nearest(i,:)');
     50%        correcti = find( (rankmat(:,i) - answer == 0));
     51%        cumtestPerf = cumtestPerf + size(correcti,1) / size(answer,1);
     52%        rank(i) = cumtestPerf;
     53%end
    5254
    5355%For FERET test, want probeID (answer), then rank, then matched ID no.,
Note: See TracChangeset for help on using the changeset viewer.