如何获得交叉验证的准确性

时间:2017-05-10 21:50:00

标签: matlab machine-learning naivebayes

我正在从这个页面学习数据集。 https://www.mathworks.com/help/stats/examples/classification.html

我现在的代码是:

load iris_dataset.dat
gscatter(meas(:,1), meas(:,2), species,'rgb','osd');
xlabel('Sepal length');
ylabel('Sepal width');
N = size(meas,1);
cp = cvpartition(species,'KFold',10)
nbGau = fitcnb(meas(:,1:2), species);
nbGauResubErr = resubLoss(nbGau)
nbGauCV = crossval(nbGau, 'CVPartition',cp);
nbGauCVErr = kfoldLoss(nbGauCV)
labels = predict(nbGau, [x y]);
gscatter(x,y,labels,'grb','sod')

我只能获得重新验证错误和交叉验证错误,我怎样才能获得分类准确性?

0 个答案:

没有答案