https://cn.mathworks.com/help/stats/support-vector-machines-for-binary-classification.html#bsr5ovw-1
使用支持向量机
与任何监督式学习模型一样,您首先训练支持向量机,然后交叉验证分类器。 使用训练好的机器对新数据进行分类(预测)。 另外,为了获得令人满意的预测准确性,您可以使用各种SVM内核函数,并且必须调整内核函数的参数。
1、训练SVM分类器
使用fitcsvm训练并选择交叉验证SVM分类器,最常用的语法是:
SVMModel = fitcsvm(X,Y,'KernelFunction','rbf',...
'Standardize',true,'ClassNames',{'negClass','posClass'});
The inputs are:
- X — Matrix of predictor data, where each row is one observation, and each column is one predictor.
- Y — Array of class labels with each row corresponding to the value of the corresponding row in X. Y can be a character array, categorical, logical or numeric vector, or cell vector of character vectors. Column ve