knncFuzzy

Fuzzy k-nearest neighbor classifier

Contents

Syntax

Description

testOut = knncFuzzy(testSet, trainSet, opt) returns the result of fuzzy KNN classifier, using the given training set trainSet and test set testSet.

References

  1. [1] J. M. Keller, M. R. Gray, and J. A. Givens, Jr., "A Fuzzy
  2. K-Nearest Neighbor Algorithm", IEEE Transactions on Systems,
  3. Man, and Cybernetics, Vol. 15, No. 4, pp. 580-585, 1985.

Example

[trainSet, testSet]=prData('3classes');
opt=knncFuzzy('defaultOpt');
opt.k=5;
opt.m=2;
[fuzzyOutput, crispOutput]=knncFuzzy(testSet, trainSet, opt, 1);
fprintf('Recog. rate = %.2f%%\n', 100*sum(crispOutput==testSet.output)/length(testSet.output));
Recog. rate = 88.00%

See Also

classFuzzify.


Top page   Next: knncEval.m   Prev:knncLoo.m