资源简介
基于matlab的svr代码示例基于matlab的svr代码示例基于matlab的svr代码示例
代码片段和文件信息
function [nsv beta bias] = svr(XYkerClosse)
%SVR Support Vector Regression
%
% Usage: [nsv beta bias] = svr(XYkerClosse)
%
% Parameters: X - Training inputs
% Y - Training targets
% ker - kernel function
% C - upper bound (non-separable case)
% loss - loss function
% e - insensitivity
% nsv - number of support vectors
% beta - Difference of Lagrange Multipliers
% bias - bias term
%
% Author: Steve Gunn (srg@ecs.soton.ac.uk)
if (nargin < 3 | nargin > 6) % check correct number of arguments
help svr
else
fprintf(‘Support Vector Regressing ....\n‘)
fprintf(‘______________________________\n‘)
n = size(X1);
if (nargin<6) e=0.0; end
if (nargin<5) loss=‘eInsensitive‘; end
if (nargin<4) C=Inf; end
if (nargin<3) ker=‘linear‘; end
% tolerance for Support Vector Detection
epsilon = svtol(C);
% Construct the Kernel matrix
fprintf(‘Constructing ...\n‘);
H = zeros(nn);
for i=1:n
for j=1:n
H(ij) = svkernel(kerX(i:)X(j:));
end
end
% Set up the parameters for the Optimisation problem
switch lower(loss)
case ‘einsensitive‘
Hb = [H -H; -H H];
c = [(e*ones(n1) - Y); (e*ones(n1) + Y)];
vlb = zeros(2*n1); % Set the bounds: alphas >= 0
vub = C*ones(2*n1); % alphas <= C
x0 = zeros(2*n1); % The starting point is [0 0 0 0]
neqcstr = nobias(ker); % Set the number of equality constraints (1 or 0)
if neqcstr
A = [ones(1n) -ones(1n)]; b = 0; % Set the constraint Ax = b
else
A = []; b = [];
end
case ‘quadratic‘
Hb = H + eye(n)/(2*C);
c = -Y;
vlb = -1e30*ones(n1);
vub = 1e30*ones(n1);
x0 = zeros(n1); % The start
相关资源
- 基于matlab的神经网络dropout层
- 使用matlab 实现DTW算法
- 基于粒子群算法的优化模型matlab程序
- 遗传算法完整MATLAB程序
- MATLAB灰色关联度代码
-
simuli
nk计数器、累加器.zip - 仿真了两径瑞利衰落信道模型和多径
- matlab读取并显示遥感img图像,包含单
- 快速随机搜索树RRT算法
-
MATLAB模糊控制及simuli
nk仿真 - psot工具箱及使用说明.zip
- 基于matlab的最小生成树prim算法
- matlab拟合程序
- GPS捕获跟踪定时同步的matlab代码
- 龙贝格算法MATLAB程序
- Matlab2017a许可证
- 基于聚类的路标检测K-meansMATLAB(RGB)
- dijkstra算法的MATLAB实现258163
- matlab程序.rar
- H-a-A-Wishart分类.zip
- Bayesian_estimate .m
- MATLAB GUI语音信号特征提取
- 遗传算法函数优化matlab代码
- WSN仿真-MATLAB基于COMPOW协议下的网络连
- 维纳滤波Matlab实现
- 动物图像多分类识别MATLAB可运行
- 龙格库塔原理详解及解微分方程组的
- 基于MATLAB的简单计算器
- 偏微分方程数值解迎风格式代码
-
直流降压斩波电路-simuli
nk仿真.rar
评论
共有 条评论