matlab交叉验证结合二次多维非线性无约束寻优法对LSSVM进行参数选取

方法1:

fold=10;

[gam,sig2] = tunelssvm({train_s,train_cl,'f',[],[],'RBF_kernel','original'},'gridsearch','crossvalidatelssvm',{K-fold,'mse'});

model = initlssvm(train_s,train_cl,'f',gam,sig2,'RBF_kernel','original');
model = trainlssvm(model);  % 训练
test_out= simlssvm(model,test_s);

 

方法2:

 

fold=10;

model= tunelssvm({train_s,train_cl,'f',[],[],'RBF_kernel','original'},'gridsearch','crossvalidatelssvm',{K-fold,'mse'});

model = trainlssvm(model);  % 训练
test_out= simlssvm(model,test_s);

你可能感兴趣的:(matlab)