function [svm_struct, svIndex] = svmtrain(training, groupnames, varargin)
%SVMTRAIN Train a support vector machine classifier
% SVMSTRUCT = SVMTRAIN(TRAINING, Y) trains a support vector machine (SVM)
% classifier on data taken from two groups. TRAINING is a numeric matrix
% of predictor data. Rows of TRAINING correspond to observations; columns
% correspond to features. Y is a column vector that contains the known
% class labels for TRAINING. Y is a grouping variable, i.e., it can be a
% categorical, numeric, or logical vector; a cell vector of strings; or a
% character matrix with each row representing a class label (see help for
% groupingvariable). Each element of Y specifies the group the
% corresponding row of TRAINING belongs to. TRAINING and Y must have the
% same number of rows. SVMSTRUCT contains information about the trained
% classifier, including the support vectors, that is used by SVMCLASSIFY
% for classification. SVMTRAIN treats NaNs, empty strings or 'undefined'
% values as missing values and ignores the corresponding rows in
% TRAINING and Y.
%
% SVMSTRUCT = SVMTRAIN(TRAINING, Y, 'PARAM1',val1, 'PARAM2',val2, ...)
% specifies one or more of the following name/value pairs:
%
% Name Value
% 'kernel_function' A string or a function handle specifying the
% kernel function used to represent the dot
% product in a new space. The value can be one of
% the following:
% 'linear' - Linear kernel or dot product
% (default). In this case, SVMTRAIN
% finds the optimal separating plane
% in the original space.
% 'quadratic' - Quadratic kernel
% 'polynomial' - Polynomial kernel with default
% order 3. To specify another order,
% use the 'polyorder' argument.
% 'rbf' - Gaussian Radial Basis Function
% with default scaling factor 1. To
% specify another scaling factor,
% use the 'rbf_sigma' argument.
% 'mlp' - Multilayer Perceptron kernel (MLP)
% with default weight 1 and default
% bias -1. To specify another weight
% or bias, use the 'mlp_params'
% argument.
% function - A kernel function specified using
% @(for example @KFUN), or an
% anonymous function. A kernel
% function must be of the form
%
% function K = KFUN(U, V)
%
% The returned value, K, is a matrix
% of size M-by-N, where M and N are
% the number of rows in U and V
% respectively.
%
% 'rbf_sigma' A positive number specifying the scaling factor
% in the Gaussian radial basis function kernel.
% Default is 1.
%
% 'polyorder' A positive integer specifying the order of the
% polynomial kernel. Default is 3.
%
% 'mlp_params' A vector [P1 P2] specifying the parameters of MLP
% kernel. The MLP kernel takes the form:
% K = tanh(P1*U*V' + P2),
% where P1 > 0 and P2 < 0. Default is [1,-1].
%
% 'method' A string specifying the method used to find the
% separating hyperplane. Choices are:
% 'SMO' - Sequential Minimal Optimization (SMO)
% method (default). It implements the L1
% soft-margin SVM classifier.
% 'QP' - Quadratic programming (requires an
% Optimization Toolbox license). It
% implements the L2 soft-margin SVM
% classifier. Method 'QP' doesn't scale
% well for TRAINING with large number of
% observations.
% 'LS' - Least-squares method. It implements the
% L2 soft-margin SVM classifier.
%
% 'options' Options structure created using either STATSET or
% OPTIMSET.
% * When you set 'method' to 'SMO' (default),
% create the options structure using STATSET.
% Applicable options:
% 'Display' Level of display output. Choices
% are 'off' (the default), 'iter', and
% 'final'. Value 'iter' reports every
% 500 iterations.
% 'MaxIter' A positive integer specifying the
% maximum number of iterations allowed.
% Default is 15000 for method 'SMO'.
% * When you set method to 'QP', create the
% options structure using OPTIMSET. For details
% of applicable options choices, see QUADPROG
% options. SVM uses a convex quadratic program,
% so you can choose the 'interior-point-convex'
% algorithm in QUADPROG.
%
% 'tolkkt' A positive scalar that specifies the tolerance
% with which the Karush-Kuhn-Tucker (KKT) conditions
% are checked for method 'SMO'. Default is
% 1.0000e-003.
%
% 'kktviolationlevel' A scalar specifying the fraction of observations
% that are allowed to violate the KKT conditions for
% method 'SMO'. Setting this value to be positive
% helps the algorithm to converge faster if it is
% fluctuating near a good solution. Default is 0.
%
% 'kernelcachelimit' A positive scalar S specifying the size of the
% kernel matrix cache for method 'SMO'. The
% algorithm keeps a matrix with up to S * S
% double-precision numbers in memory. Default is
% 5000. When the number of points in TRAINING
% exceeds S, the SMO method slows down. It's
% recommended to set S as large as your system
% permits.
%
% 'boxconstraint' The box constraint C for the soft margin. C can be
% a positive numeric scalar or a vector of positive
% numbers with the number of elements equal to the
% number of rows in TRAINING.
% Default is 1.
% * If C is a scalar, it is automatically rescaled
% by N/(2*N1) for the observations of group one,
% and by N/(2*N2) for the observations of group
% two, where N1 is the number of observations in
% group one, N2 is the number of observations in
% group two. The rescaling is done to take into
% account unbalanced groups, i
没有合适的资源?快使用搜索试试~ 我知道了~
【SVM预测】基于布谷鸟搜索算法优化SVM预测附matlab代码.rar
共23个文件
m:16个
mat:2个
mexw64:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 132 浏览量
2024-10-22
10:46:21
上传
评论
收藏 185KB RAR 举报
温馨提示
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 替换数据可以直接使用,注释清楚,适合新手
资源推荐
资源详情
资源评论
收起资源包目录
【SVM预测】基于布谷鸟搜索算法优化SVM预测附matlab代码.rar (23个子文件)
【SVM预测】基于布谷鸟搜索算法优化SVM预测附matlab代码
wndspd.mat 447B
fobj.m 430B
cuckoo_ori_with_chinese_note.m 6KB
Split.m 1KB
wine.mat 20KB
simplebounds.m 376B
【预测模型-SVM预测】基于布谷鸟搜索算法优化SVM预测代码.zip 92KB
svmpredict.mexw64 24KB
mymape.m 85B
empty_nests.m 999B
TEST.m 2KB
CS_SVR_exmp.m 3KB
get_best_nest.m 676B
【预测模型】基于布谷鸟算法改进SVM实现预测matlab代码2.md 5KB
运行结果.png 23KB
svmtrain.m 24KB
get_cuckoos.m 2KB
mymae.m 70B
get_best_nest_svm.m 698B
CS_SVM_exmp.m 3KB
objfun.m 402B
svmtrain.mexw64 61KB
mymse.m 74B
共 23 条
- 1
资源评论
天天Matlab科研工作室
- 粉丝: 4w+
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- C#ASP.NET厚溥申请单管理系统源码数据库 SQL2008源码类型 WebForm
- C#计算机教学网站源码数据库 SQL2008源码类型 WebForm
- unity +xchart 各种图表
- Delphi 12 控件之TMS WEB Core 2.6.1.3 Retail Setup for D11.rar
- SecureCRT(1).zip
- C#ASP.NET书法网站源码数据库 SQL2008源码类型 WebForm
- micropyth与mpu6050
- Delphi 12 控件之VclToFmxConvert.zip
- JAVA的SpringBoot+Vue学生管理系统源码数据库 MySQL源码类型 WebForm
- MySQL数据库标准安装文档-V2.0
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功