朴素贝叶斯matlab实现(共7页).docx
《朴素贝叶斯matlab实现(共7页).docx》由会员分享,可在线阅读,更多相关《朴素贝叶斯matlab实现(共7页).docx(7页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上clcclearclose alldata=importdata(data.txt);wholeData=data.data;%交叉验证选取训练集和测试集cv=cvpartition(size(wholeData,1),holdout,0.04);%0.04表明测试数据集占总数据集的比例cvpartition(n,holdout,p)创建一个随机分区,用于在n个观测值上进行保持验证。该分区将观察分为训练集和测试(或保持)集。参数p必须是标量,当0pPxyPy2&PxyPy1PxyPy3 predictLabel(kk,1)=1; disp(this item belo
2、ngs to No.,num2str(1), label or the R label) labelPredictNumber(1,1)=labelPredictNumber(1,1)+1; elseif PxyPy2PxyPy1&PxyPy2PxyPy3 predictLabel(kk,1)=2; labelPredictNumber(2,1)=labelPredictNumber(2,1)+1; disp(this item belongs to No.,num2str(2), label or the B label) elseif PxyPy3PxyPy2&PxyPy3PxyPy1 p
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 朴素 贝叶斯 matlab 实现
限制150内