fitsvm in MATLAB 2014 and svmtrain in previous version

matlab 2014以前的版本不包含fitcsvm()训练函数,而是以svmtrain()函数代替。网上找到的关于此函数的资料

原文:http://blog.163.com/liu_xi_en/blog/static/2817450620102297336227/


最近结合ACO和SVM做分类,于是仔细看了下svmtrain的help文档。现结合该doc文档,做简单整理,希望对

svm入门者有点帮助哦。

         svmtrain:用于训练支持向量机分类器。语法格式如下:

SVMStruct = svmtrain(TrainingGroup)

SVMStruct = svmtrain(..., 'Kernel_Function', Kernel_FunctionValue, ...)

SVMStruct = svmtrain(..., 'RBF_Sigma', RBFSigmaValue, ...)

SVMStruct = svmtrain(..., 'Polyorder', PolyorderValue, ...)

SVMStruct = svmtrain(..., 'Mlp_Params', Mlp_ParamsValue, ...)

SVMStruct = svmtrain(..., 'Method', MethodValue, ...)

SVMStruct = svmtrain(..., 'QuadProg_Opts', QuadProg_OptsValue, ...)

SVMStruct = svmtrain(..., 'SMO_Opts', SMO_OptsValue, ...)

SVMStruct = svmtrain(..., 'BoxConstraint', BoxConstraintValue, ...)

SVMStruct = svmtrain(..., 'Autoscale', AutoscaleValue, ...)

SVMStruct = svmtrain(..., 'Showplot', ShowplotValue, ...)

解释如下:

 Training是一个M行N列的矩阵,M是样本数,N是特征维数。Group:是个列向量,表示样本对应的类别,用字符串表示(可以用数字或单个字符)。

classifier is returned in SVMStruct, a structure with the following fields. 'Kernel_Function', Kernel_FunctionValue,.......'Showplot',ShowplotValue这些在svmtrain中是可选项。他们在svmtrain中出现的顺序是无关紧要的。但必须成对出现,前面单引号里的是字符标记,后面给出的是对应的值。Kernel_FunctionValue 有如下些可选类别: 

  • linear — Default. Linear kernel or dot product.
  • quadratic — Quadratic kernel.
  • rbf — Gaussian Radial Basis Function kernel with a default scaling factor, sigma, of 1.
  • polynomial — Polynomial kernel with a default order of 3.
  • mlp — Multilayer Perceptron kernel with default scale and bias parameters of [1, -1].

 如可通过如下来设定核函数为Gaussian Radial Basis Function kernel :

SVMStruct = svmtrain(TrainingGroup, 'Kernel_Function', rbf);

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值