Guide to using support vctor machine toolbox on Matlab.
转自:headway Matlab支持向量机工具箱的使用说明(一) svmclassify
Matlab支持向量机工具箱的使用说明(一)
(Guide to using support vctor machine toolbox)
svmclassify
Classify data using support vector machine
使用支持向量机对数据分类
Syntax 语法
Group = svmclassify(SVMStruct, Sample)
Group = svmclassify(SVMStruct, Sample, 'Showplot', ShowplotValue)
Description 说明
Group = svmclassify(SVMStruct, Sample) classifies each row of the data in Sample using the information in a support vector machine classifier structure SVMStruct, created using the svmtrain function. Sample must have the same number of columns as the data used to train the classifier in svmtrain. Group indicates the group to which each row of Sample has been assigned.
Group = svmclassify(SVMStruct, Sample)根据一个由svmtrain函数生成的支持向量机分类器结构体SVMStruct里的信息对样本里的每一行数据进行分类。样本sample必须和用于在svmtrain中训练分类器的数据集data有相同的列数。组group指明了该组与样本sample相对应的每一行数据的指派(即sample每一行被分哪一类)。
Group = svmclassify(SVMStruct, Sample, 'Showplot', ShowplotValue) controls the plotting of the sample data in the figure created using the Showplot property with the svmtrain function.
Group = svmclassify(SVMStruct, Sample, 'Showplot', ShowplotValue) 控制着样本数据在图形上的测绘,图形由showplot的属性和svmtrain函数共同产生。
用例:classes = svmclassify(svmStruct,test,'showplot',true);
% svmStruct 由函数svmtrain得到
% test是用于检验分类器的测试数据集