
1 简介
为了提高支持向量机(SVM)模型的拟合精度和泛化能力,以最小化输出量的均方误差为目标,采用基于万有引力定律的优化机制,提出了一种基于引力搜索算法的SVM参数优化方法.通过仿真实验验证,基于引力搜索算法的SVM回归模型不但精度高且泛化能力强.将该方法应用于谷氨酸发酵过程的建模研究,仿真结果表明,该方法可以提高谷氨酸质量浓度的预测精度.






2 部分代码
% GSA code v1.0.% Generated by Esmat Rashedi, 2009.% Adopted from: " E. Rashedi, H. Nezamabadi-pour and S. Saryazdi,% 揋SA: A Gravitational Search Algorithm? Information sciences, vol. 179,% no. 13, pp. 2232-2248, 2009."% Gravitational Search Algorithm.function BestChart=GSA(F_index,N,max_it,ElitistCheck,chaosIndex,chValueInitial)%V: Velocity.%a: Acceleration.%M: Mass. Ma=Mp=Mi=M;%dim: Dimension of test function.%N: Number of agents.%X: Position of agents. dim-by-N matrix.%R: Distance between agents in search space.%[low-up]: Allowable range for search space.%Rnorm: Norm in eq.8.%Rpower: Power of R in eq.7.G_History=zeros(1,max_it);Rnorm=2;Rpower=1;min_flag=1; % 1: minimization, 0: maximization%get allowable range and dimension of the test function.[low,up,dim]=test_functions_range(F_index);%random initialization for agents.X=initialization(dim,N,up,low);%create chart of best so far and average fitnesses.BestChart=[];MeanChart=[];V=zeros(dim,N);wMax=chValueInitial;wMin=1e-10;for iteration=1:max_itchValue=wMax-iteration*((wMax-wMin)/max_it);% iteration%Checking allowable range.X=space_bound(X,up,low);%Evaluation of agents.fitness=evaluateF(X,F_index);[best best_X]=min(fitness); %min: minimization. max: maximization.if iteration==1Fbest=best;Lbest=X(:,best_X);endif best<Fbest % < : minimization. > : maximizationFbest=best;Lbest=X(:,best_X);endBestChart=[BestChart Fbest];MeanChart=[MeanChart mean(fitness)];%Calculation of M. eq.14-20[M]=massCalculation(fitness,min_flag);%Calculation of Gravitational constant. eq.13.G=Gconstant(iteration,max_it);%G=chaos(3,iteration,max_it,10);switch chaosIndexcase 1G=Gconstant(iteration,max_it);case 2G=G+chaos(chaosIndex-1,iteration,max_it,chValue);case 3G=G+chaos(chaosIndex-1,iteration,max_it,chValue);case 4G=G+chaos(chaosIndex-1,iteration,max_it,chValue);case 5G=G+chaos(chaosIndex-1,iteration,max_it,chValue);case 6G=G+chaos(chaosIndex-1,iteration,max_it,chValue);case 7G=G+chaos(chaosIndex-1,iteration,max_it,chValue);case 8G=G+chaos(chaosIndex-1,iteration,max_it,chValue);case 9G=G+chaos(chaosIndex-1,iteration,max_it,chValue);case 10G=G+chaos(chaosIndex-1,iteration,max_it,chValue);case 11G=G+chaos(chaosIndex-1,iteration,max_it,chValue);endG_History(iteration)=G;test_G(iteration)=G;if iteration==499alisop=0;end%Calculation of accelaration in gravitational field. eq.7-10,21.a=Gfield(M,X,G,Rnorm,Rpower,ElitistCheck,iteration,max_it);%Agent movement. eq.11-12[X,V]=move(X,a,V);end %iteration
3 仿真结果

4 参考文献
[1]戴娟, 顾斌杰, 潘丰. 基于引力搜索算法的SVM参数优化及应用[J]. 服装学报, 2013, 12(002):127-131.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。
本文介绍了一种利用引力搜索算法改进支持向量机(SVM)回归模型的方法,通过仿真验证了其在提高精度和泛化能力方面的有效性。特别地,该算法被成功应用于谷氨酸发酵过程的建模,结果显示显著提升了预测精度。
2070

被折叠的 条评论
为什么被折叠?



