MATLAB 代码
一、直接 SVM 分类
data=xlsread('BreastCancer_data');
model=libsvmtrain(data(1:470,11),data(1:470,2:10));
[data(471:683,12),accuracy,dec_values]=libsvmpredict(data(471:683,11),data(471:683,2:1
0),model);
MATLAB 输出结果
optimization finished, #iter = 372
nu = 0.163021
obj = -46.105766, rho = 0.760988
nSV = 234, nBSV = 29
Total nSV = 234
Accuracy = 98.1221% (209/213) (classification)
二、基于粒子群优化算法的特征选择 SVM 分类
I. 清空环境
clc
clear