资源简介
粒子群优化SVM系数,matlab源代码,可以使用
代码片段和文件信息
%% 清空环境
clc
clear
load wine;
train = [wine(1:30:);wine(60:95:);wine(131:153:)];
train_label = [wine_labels(1:30);wine_labels(60:95);wine_labels(131:153)];
test = [wine(31:59:);wine(96:130:);wine(154:178:)];
test_label = [wine_labels(31:59);wine_labels(96:130);wine_labels(154:178)];
[trainpstrain] = mapminmax(train‘);
pstrain.ymin = 0;
pstrain.ymax = 1;
[trainpstrain] = mapminmax(trainpstrain);
[testpstest] = mapminmax(test‘);
pstest.ymin = 0;
pstest.ymax = 1;
[testpstest] = mapminmax(testpstest);
train = train‘;
test = test‘;
%% 参数初始化
%粒子群算法中的两个参数
c1 = 1.6; % c1 belongs to [02]
c2 = 1.5; % c2 belongs to [02]
maxgen=300; % 进化次数
sizepop=30; % 种群规模
popcmax=10^(2);
popcmin=10^(-1);
popgmax=10^(3);
popgmin=10^(-2);
k = 0.6; % k belo
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3863 2009-10-29 18:32 新建文件夹\pso-cg.m
目录 0 2009-12-04 15:41 新建文件夹
----------- --------- ---------- ----- ----
3863 2
- 上一篇:gui 图像读取与保存
- 下一篇:Box-Cox变换的matlab程序
评论
共有 条评论