from
Parzen classifier
by Sebastien PARIS
Mex implementation of a Parzen classifier
|
| test_parzen.m |
load wine
[d , N] = size(X);
n1 = round(0.7*N);
n2 = N - n1;
nbite = 1000;
sigma = 1;
Perf = zeros(1 , nbite);
for i=1:nbite
ind = randperm(length(y));
ind1 = ind(1:n1);
ind2 = ind(n1+1:N);
Xtrain = X(: , ind1);
ytrain = y(ind1);
Xtest = X(: , ind2);
ytest = y(ind2);
ytest_est = parzen_classif(Xtrain , ytrain , Xtest , sigma );
Perf(i) = sum(ytest == ytest_est)/n2;
end
disp(sprintf('Performance = %4.2f' , mean(Perf)))
|
|
Contact us at files@mathworks.com