赞
踩
1.SO-CNN-SVM蛇群算法优化卷积神经网络-支持向量机的多变量回归预测 可直接运行Matlab;
2.评价指标包括: R2、MAE、RMSE和MAPE等,代码质量极高,方便学习和替换数据。要求2021版本及以上。
3.蛇群算法SO优化的参数为:CNN的批处理大小、学习率、正则化系数,能够避免人工选取参数的盲目性,有效提高其预测精度。
4.main.m为主程序,其他为函数文件,无需运行,data为数据,多输入单输出,数据回归预测,输入7个特征,输出1个变量,直接替换Excel数据即可用!注释清晰,适合新手小白~
%Initialize the positions of search agents Positions=initialization(pop,dim,ub,lb); curve=zeros(1,Max_iter); t=0;% Loop counter % Main loop while t<Max_iter for i=1:size(Positions,1) % Return back the search agents that go beyond the boundaries of the search space Flag4ub=Positions(i,:)>ub; Flag4lb=Positions(i,:)<lb; Positions(i,:)=(Positions(i,:).*(~(Flag4ub+Flag4lb)))+ub.*Flag4ub+lb.*Flag4lb; % Calculate objective function for each search agent fitness=fobj(Positions(i,:)); % Update the leader if fitness<Best_Cost % Change this to > for maximization problem Best_Cost=fitness; % Update alpha Best_pos=Positions(i,:); end end
[1] https://blog.csdn.net/kjm13182345320/article/details/129036772?spm=1001.2014.3001.5502
[2] https://blog.csdn.net/kjm13182345320/article/details/128690229
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。