1. KNN 分类

load fisheriris
X = meas;
Y = species;                                % 3 分类问题

% 通过训练集进行训练
Mdl = fitcknn(X, Y, 'NumNeighbors', 4);

% 对 mean of dataset 进行预测
flwr = mean(X); % an average flower
flwrClass = predict(Mdl,flwr)
posted on 2017-05-25 18:23  未雨愁眸  阅读(1094)  评论(0编辑  收藏  举报