资源简介
进行SVM时运用高斯核,需要参数选择,改程序用来参数选择
代码片段和文件信息
function [bestaccbestcbestg] = SVMcgForClass(train_labeltraincmincmaxgmingmaxvcstepgstepaccstep)
%SVMcg cross validation by faruto
%
% by faruto
%Email:patrick.lee@foxmail.com QQ:516667408 http://blog.sina.com.cn/faruto BNU
%last modified 2010.01.17
%% 若转载请注明:
% faruto and liyang LIBSVM-farutoUltimateVersion
% a toolbox with implements for support vector machines based on libsvm 2009.
%
% Chih-Chung Chang and Chih-Jen Lin LIBSVM : a library for
% support vector machines 2001. Software available at
% http://www.csie.ntu.edu.tw/~cjlin/libsvm
%% about the parameters of SVMcg
if nargin < 10
accstep = 4.5;
end
if nargin < 8
cstep = 0.8;
gstep = 0.8;
end
if nargin < 7
v = 5;
end
if nargin < 5
gmax = 8;
gmin = -8;
end
if nargin < 3
cmax = 8;
cmin = -8;
end
%% X:c Y:g cg:CVaccuracy
[XY] = meshgrid(cmin:cstep:cmaxgmin:gstep:gmax);
[mn] = size(X);
cg = zeros(mn);
eps = 10^(-4);
%% record acc with different c & gand find the bestacc with the smallest c
bestc = 1;
bestg = 0.1;
bestacc = 0;
basenum = 2;
for i = 1:m
for j = 1:n
cmd = [‘-v ‘num2str(v)‘ -c ‘num2str( basenum^X(ij) )‘ -g ‘num2str( basenum^Y(ij) )];
cg(ij
- 上一篇:道路图像分割程序
- 下一篇:宽带信号DOA估计算法
相关资源
- 非线性SVM算法-matlab实现
- SVM工具箱(matlab中运行)
- matlab版的车牌识别程序
- SVM的回归预测分析——上证指数开盘
- 印章识别matlab代码
- ibsvm-3.21
- 果蝇参数寻优FOA-LSSVM的完整程序
- 利用WOA算法优化libsvm中SVDD算法的参数
- svm支持向量机与nbc朴素贝叶斯算法比
- SVM的matlab代码
- 混凝土抗压强度预测_SVM_Matlab_归一_
- 基于SVM的回归预测分析
- libsvm数据格式转换程序
- 基于SVM的matlab车牌识别
- hog+svm图像二分类
- 基于PCA和SVM的人脸识别.zip
- 《MATLAB 神经网络30个案例分析》所有
- SVM分类与回归的matlab代码
- 基于LABVIEW和MATLAB混合编程障碍物识别
- svm 支持向量机 回归 预测
- libsvm - 支持多类别分类的svm工具箱m
- 经典SVM算法的MATLAB程序
- 蚁群优化SVM系数
- SVM-KM Matlab源程序
- 模式识别课程作业 基于svm的人脸识别
- MATLAB的SVM安装包drtoolbox_libsvm-3.17
- SVM算法对MNIST数据集分类
- 遗传算法优化支持向量机GASVM
- 经典SVM算法matlab程序
- SVM分类器.zip
评论
共有 条评论