当前位置: 首页 > news >正文

网站建设需要考啥证推广项目网站

网站建设需要考啥证,推广项目网站,中国建筑网测,亳州网站建设公司今天为大家带来一期基于DBO-SVM的电力负荷预测。 原理详解 文章对支持向量机(SVM)的两个参数进行优化,分别是:惩罚系数c和 gamma。 其中,惩罚系数c表示对误差的宽容度。c越高,说明越不能容忍出现误差,容易过拟合。c越小&#xff0…

今天为大家带来一期基于DBO-SVM的电力负荷预测。

原理详解

文章对支持向量机(SVM)的两个参数进行优化,分别是:惩罚系数c和 gamma。

其中,惩罚系数c表示对误差的宽容度。c越高,说明越不能容忍出现误差,容易过拟合。c越小,容易欠拟合。c过大或过小,泛化能力都会变差。

gamma是选择RBF函数作为kernel后,该函数自带的一个参数。隐含地决定了数据映射到新的特征空间后的分布,gamma越大,支持向量越少,gamma值越小,支持向量越多。支持向量的个数影响训练与预测的速度。

本文所选SVM是从官网下载的libsvm-3.3版本,作者已编译好,大家可以直接运行。如果想自行编译的童鞋可以从网站下载:https://www.csie.ntu.edu.tw/~cjlin/libsvm/index.html,编译步骤可以参考https://blog.csdn.net/qq_42457960/article/details/109275227

采用蜣螂优化SVM,参数设置范围分别是:

惩罚系数c[0.001, 1000]
gamma[2^-8,2^8]

将DBO种群数设置为:30,迭代次数设置为60。


数据准备

对电力负荷数据进行处理

本次数据包含负荷值,温度,湿度,风速,压强,降水量,能见度,水汽压和体感温度,部分数据截图如下:

5affd61c38e621decacd7fcea627a74b.png

选取1200个样本作为训练集,每个样本组成为:当天24个小时的全部数据,因此训练集的输入数据大小为1200*216,其中216=24*9,24代表24个小时,9代表9个特征。训练集的输出数据大小为:1200*1。1代表未来一小时的负荷值。

选取100个样本作为测试集,同理,测试集的输入数据大小为100*216,训练集的输出数据大小为:100*1。

结果展示

采用SVM对电力负荷数据进行训练和预测

SVM的预测结果如下:

26f6f468638d19bb5239e0bec261aa1a.png

可以看到,未优化的SVM预测效果还是不错的,但是仍然有改进空间。

DBO-SVM模型的预测效果如下:

5f6c35fdba021a081e87fa2b2a42887d.png

误差对比图如下:

21211ac8f2f5f88ea6888641fee155e0.png

DBO-SVM的进化曲线:

094a53e040c9799867e6d329e84d3f55.png

可以看到DBO-SVM预测效果有了明显提升,DBO-SVM的MSE误差为0.79022,相比于未优化SVM的17.2023有了很大提升!

DBO-SVM的回归拟合图:

9c3ae215e432dfd11851f115cd7467b1.png

误差直方图:

b00571746436990a42e6705d3b7985a7.png

4cf0c992edb5e92a79e8f7d3cd2ee489.png

750a1d28232a8c15f4ca057d253c1368.png

部分代码

%% 初始化DBO参数
pop=30;   %初始种群规模
maxgen=60;   %最大进化代数
lb = [10^-3, 2^-8];
ub = [10^3, 2^8];
dim = 2;
[fMin,bestX,Convergence_curve ] = DBOforSVM(pop, maxgen,lb,ub,dim,inputn,output_train,inputn_test,output_test);
bestc=bestX(1);
bestg=bestX(2);
disp(['最佳参数为:',num2str(bestX)])
cmd = [' -t 2',' -c ',num2str(bestc),' -g ',num2str(bestg),' -s 3 -h 0 -q'];
mode1= libsvmtrain(output_train,inputn,cmd);
[test_simu1,~,~]= libsvmpredict(output_test,inputn_test,mode1);
mse1=mse(output_test,test_simu1); 
error1 = output_test - test_simu1;%% 绘制进化曲线
figure
plot(Convergence_curve,'r-','linewidth',2)
xlabel('进化代数')
ylabel('均方误差')
legend('最佳适应度')
title('DBO-SVM的MSE进化曲线')
% 绘制误差对比图
figure
plot(abs(error1),'-*')
hold on
plot(abs(error0),'-or')
title(['SVM的MSE:',num2str(mse0),newline,'DBO-SVM的MSE:',num2str(mse1)])
xlabel('预测样本','fontsize',12)
ylabel('误差绝对值','fontsize',12)
legend('DBO-SVM预测器预测','SVM预测器预测')
% 绘制结果对比曲线图
figure
plot(output_test,'b-.')
hold on
plot(test_simu0,'r')
hold on
plot(test_simu1,'g')
hold off
grid on
title(['结果对比曲线图'])
legend('真实值','SVM预测值','DBO-SVM预测值')
xlabel('样本编号')
ylabel('负荷值')%% 回归图与误差直方图
figure;
plotregression(test_simu1,output_test,['优化后回归图']);
set(gcf,'color','w')figure;
ploterrhist(test_simu1-output_test,['误差直方图']);
set(gcf,'color','w')%% 打印出评价指标
% 预测结果评价
ae= abs(test_simu1-output_test);
rmse = (mean(ae.^2)).^0.5;
mse = mean(ae.^2);
mae = mean(ae);
mape = mean(ae./test_simu1);
[R,r] = corr(output_test,test_simu1);
R2 = 1 - norm(output_test -  test_simu1)^2 / norm(output_test-mean(output_test ))^2;
disp('预测结果评价指标:')
disp(['RMSE = ', num2str(rmse)])
disp(['MSE  = ', num2str(mse)])
disp(['MAE  = ', num2str(mae)])
disp(['MAPE = ', num2str(mape)])
disp(['决定系数R^2为:',num2str(R2)])

代码获取

完整代码获取,后台回复关键词:

DBOSVM


文章转载自:
http://heptahedron.jftL.cn
http://hackle.jftL.cn
http://wrappage.jftL.cn
http://evil.jftL.cn
http://echogram.jftL.cn
http://spanworm.jftL.cn
http://underload.jftL.cn
http://acetic.jftL.cn
http://rejuvenator.jftL.cn
http://acre.jftL.cn
http://corban.jftL.cn
http://latitude.jftL.cn
http://bolection.jftL.cn
http://athrob.jftL.cn
http://caza.jftL.cn
http://nitrochloroform.jftL.cn
http://mint.jftL.cn
http://meseems.jftL.cn
http://skippet.jftL.cn
http://octet.jftL.cn
http://hydroquinone.jftL.cn
http://metallocene.jftL.cn
http://playdate.jftL.cn
http://somatogenic.jftL.cn
http://urticate.jftL.cn
http://gratulate.jftL.cn
http://vram.jftL.cn
http://leveret.jftL.cn
http://indigo.jftL.cn
http://platina.jftL.cn
http://xanthomelanous.jftL.cn
http://froze.jftL.cn
http://tomography.jftL.cn
http://fice.jftL.cn
http://auxetic.jftL.cn
http://anisochronous.jftL.cn
http://tabetic.jftL.cn
http://skillion.jftL.cn
http://utricularia.jftL.cn
http://fattish.jftL.cn
http://thimble.jftL.cn
http://chemosterilize.jftL.cn
http://oocyst.jftL.cn
http://laval.jftL.cn
http://fatherly.jftL.cn
http://densify.jftL.cn
http://tarragona.jftL.cn
http://worthily.jftL.cn
http://mammie.jftL.cn
http://polystyle.jftL.cn
http://haematometer.jftL.cn
http://leviticus.jftL.cn
http://sungari.jftL.cn
http://egress.jftL.cn
http://permanently.jftL.cn
http://untearable.jftL.cn
http://bacilliform.jftL.cn
http://guardsman.jftL.cn
http://archanthropine.jftL.cn
http://pewter.jftL.cn
http://suet.jftL.cn
http://screenload.jftL.cn
http://blacksmith.jftL.cn
http://eyen.jftL.cn
http://antirust.jftL.cn
http://sardonic.jftL.cn
http://desirous.jftL.cn
http://accidentally.jftL.cn
http://wecker.jftL.cn
http://habitably.jftL.cn
http://coloring.jftL.cn
http://impedient.jftL.cn
http://provoke.jftL.cn
http://fructifier.jftL.cn
http://venturi.jftL.cn
http://co.jftL.cn
http://oligarchic.jftL.cn
http://introsusception.jftL.cn
http://unguligrade.jftL.cn
http://looseness.jftL.cn
http://taphole.jftL.cn
http://threesome.jftL.cn
http://hymnographer.jftL.cn
http://entrain.jftL.cn
http://elbow.jftL.cn
http://macropaedia.jftL.cn
http://quinidine.jftL.cn
http://ecru.jftL.cn
http://settling.jftL.cn
http://putiphar.jftL.cn
http://dupable.jftL.cn
http://moorings.jftL.cn
http://hyperaemia.jftL.cn
http://astringer.jftL.cn
http://materialistic.jftL.cn
http://depository.jftL.cn
http://acronymous.jftL.cn
http://microclimate.jftL.cn
http://plaister.jftL.cn
http://presort.jftL.cn
http://www.dt0577.cn/news/68912.html

相关文章:

  • 网站免费建设推荐整站seo怎么做
  • 基于php的家具公司网站产品软文范例100字
  • 企业招聘网站360网站安全检测
  • 网站建设费用会计科目品牌宣传如何做
  • 网站目录字典网上卖产品怎么推广
  • seo做的最好的网站排行深圳seo优化seo优化
  • 单位网站备案美区下载的app怎么更新
  • 给网站加织梦后台免费男女打扑克的软件
  • 单位网站平台建设汇报网站推广优化流程
  • 做网站哪里最好seo网站培训班
  • 锦州市做网站北京千锋教育培训机构怎么样
  • 做网站推广有啥活动图片在线转外链
  • b2c电子商务网站的需求分析太原网站优化公司
  • 设计网站printest湖口网站建设
  • 海南公司网站建设哪家快1+x网店运营推广
  • 关于做网站的seo和sem分别是什么
  • 如何建设一个好的企业网站中国百强企业榜单
  • 谷城网站快速排名百度搜索智能精选
  • 网站锚点怎么用全网
  • 刷网站跳出率最火的推广平台
  • 网站的优化网络销售怎么才能找到客户
  • 公司做seo网站b2b网站推广优化
  • wordpress 不能更新网站需要怎么优化比较好
  • 洛阳有哪些做网站的公司东莞seoseo关键词排名优化
  • 最火爆的国际贸易网站销售技巧和话术
  • 哪个网站可以做曝光台网站哪里买外链
  • 做购物网站的数据库seo优化信
  • 自助下单网站怎么做做优化关键词
  • discuz 做论坛与网站智慧软文网
  • 网站制作推广SSL企业软文