Machine Learning in MATLAB: KNN

dataset=csvread('F:\Machine Learning Training\OneDrive-2017-10-28\Datasets\clusterincluster.csv',1,0);
label = dataset(:,3);
dataset = dataset(:, 1:2);
rng(2);
Mdl =fitcnb(dataset, label, 'CrossVal', 'on','kfold',10);

Mdl =fitcdiscr(dataset, label, 'CrossVal', 'on','kfold',10);
yfit=kfoldPredict(Mdl);
conf=confusionmat(label,yfit);
gscatter(meas(:1),meas(:,2),species,'')

 

It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published.