【SVM分类】基于布谷鸟算法优化实现SVM数据分类matlab源码 (3)

【SVM分类】基于布谷鸟算法优化实现SVM数据分类matlab源码

【SVM分类】基于布谷鸟算法优化实现SVM数据分类matlab源码

CS算法的执行过程如下:

这里写图片描述

【SVM分类】基于布谷鸟算法优化实现SVM数据分类matlab源码

三、代码

clear all ; close all ; clc ; N = 25; % Number of nests(The scale of solution) D = 10 ; % Dimensionality of solution T = 200 ; % Number of iterations Xmax = 20 ; Xmin = -20 ; Pa = 0.25 ; % Probability of building a new nest(After host bird find exotic bird eggs) nestPop = rand(N,D)*(Xmax-Xmin)+Xmin ; % Random initial solutions for t=1:T levy_nestPop = func_levy(nestPop,Xmax,Xmin) ; % Generate new solutions by Levy flights nestPop = func_bestNestPop(nestPop,levy_nestPop); % Choose a best nest among new and old nests rand_nestPop = func_newBuildNest(nestPop,Pa,Xmax,Xmin); % Abandon(Pa) worse nests and build new nests by (Preference random walk ) nestPop = func_bestNestPop(nestPop,rand_nestPop) ; % Choose a best nest among new and old nests [~,index] = max(func_fitness(nestPop)) ; % Best nests trace(t) = func_objValue(nestPop(index,:)) ; end figure plot(trace); xlabel(\'迭代次数\') ; ylabel(\'适应度值\') ; title(\'适应度进化曲线\') ;

【SVM分类】基于布谷鸟算法优化实现SVM数据分类matlab源码

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zzjssx.html