【ELM预测】基于离群鲁棒极限学习机实现数据预测附matlab代码

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法  神经网络预测 雷达通信  无线传感器

信号处理 图像处理 路径规划 元胞自动机 无人机  电力系统

⛄ 内容介绍

​Extreme learning machine (ELM), as one of the most useful techniques in machine learning, has attracted extensive attentions due to its unique ability for extremely fast learning. In particular, it is widely recognized that ELM has speed advantage while performing satisfying results. However, the presence of outliers may give rise to unreliable ELM model. In this paper, our study addresses the outlier robustness of ELM in regression problems. Based on the sparsity characteristic of outliers, this work proposes an outlier-robust ELM where the 1-norm loss function is used to enhance the robustness. Specially, the fast and accurate augmented Lagrangian multiplier method is applied to guarantee the effectiveness and efficiency. According to the experiments on function approximation and some real-world applications, the proposed approach not only maintains the advantages from original ELM, but also shows notable and stable accuracy in handling data with outliers.

⛄ 部分代码

% =========================================================================

% Outlier-robust extreme learning machine, Version 1.0

%

% ----------------------------------------------------------------------

% Permission to use, copy, or modify this software and its documentation

% for educational and research purposes only and without fee is here

% granted, provided that this copyright notice and the original authors'

% names appear on all copies and supporting documentation. This program

% shall not be used, rewritten, or adapted as the basis of a commercial

% software or hardware product without first obtaining permission of the

% authors. The authors make no representations about the suitability of

% this software for any purpose. It is provided "as is" without express

% or implied warranty.

%----------------------------------------------------------------------

%

% This is an implementation of the algorithm for "SinC" function regression

%

% Please cite the following paper if you use this code:

%

% Zhang, Kai, and Minxia Luo. "Outlier-robust extreme learning machine for regression problems."

% Neurocomputing 151 (2015): 1519-1527.

%

%--------------------------------------------------------------------------

clear all;clc;

k=20;

num=1;

nodes=20;

C=[0,2^15,2^15,2^30];

[traindata,trainlabel,testdata,testlabel] = sinc(k);

i=1;

NumberofHiddenNeurons=nodes;

NumberofTrainingData=size(traindata,2);

NumberofInputNeurons=size(traindata,1);

InputWeight=rand(NumberofHiddenNeurons,NumberofInputNeurons)*2-1;

BiasofHiddenNeurons=rand(NumberofHiddenNeurons,1);

%% method ELM

[TrainingTime1,TrainingAccuracy1,InputWeight, BiasofHiddenNeurons, OutputWeight] ...

    = elm_train_main(InputWeight,BiasofHiddenNeurons,traindata,trainlabel, C(1), 1);

[TestingAccuracy1,TY1] = elm_predict(testdata,testlabel,InputWeight, BiasofHiddenNeurons, OutputWeight);

tracc1(i)=TrainingAccuracy1;

ttacc1(i)=TestingAccuracy1;

%%  method Regularizd ELM

[TrainingTime2,TrainingAccuracy2,InputWeight, BiasofHiddenNeurons, OutputWeight] ...

    = elm_train_main(InputWeight,BiasofHiddenNeurons,traindata,trainlabel, C(2), 2);

[TestingAccuracy2,TY2] = elm_predict(testdata,testlabel,InputWeight, BiasofHiddenNeurons, OutputWeight);

tracc2(i)=TrainingAccuracy2;

ttacc2(i)=TestingAccuracy2;

%%  method ELM-MAD

[TrainingTime3,TrainingAccuracy3,InputWeight, BiasofHiddenNeurons, OutputWeight] ...

    = elm_train_main(InputWeight,BiasofHiddenNeurons,traindata,trainlabel, C(3), 3);

[TestingAccuracy3,TY3] = elm_predict(testdata,testlabel,InputWeight, BiasofHiddenNeurons, OutputWeight);

tracc3(i)=TrainingAccuracy3;

ttacc3(i)=TestingAccuracy3;

%%  method ELM-L1

[TrainingTime4,TrainingAccuracy4,InputWeight, BiasofHiddenNeurons, OutputWeight] ...

    = elm_train_main(InputWeight,BiasofHiddenNeurons,traindata,trainlabel,  C(4), 4);

[TestingAccuracy4,TY4] = elm_predict(testdata,testlabel,InputWeight, BiasofHiddenNeurons, OutputWeight);

tracc4(i)=TrainingAccuracy4;

ttacc4(i)=TestingAccuracy4;

% end

fprintf(['  trainingRMSE       testingRMSE\n'])

format longg

format compact

a=single([mean(tracc1),mean(ttacc1)])

b=single([mean(tracc2),mean(ttacc2)])

c=single([mean(tracc3),mean(ttacc3)])

d=single([mean(tracc4),mean(ttacc4)])

figure;

plot(traindata,trainlabel,'o','MarkerSize',5,'MarkerFaceColor','w','MarkerEdgeColor','k','linewidth',1.2);

hold on;

plot(testdata,testlabel,'k','linewidth',1.5);

hold on;

plot(testdata,TY1,'m','linewidth',1.5);

hold on;

plot(testdata,TY2,'b','linewidth',1.5);

hold on;

plot(testdata,TY3,'g','linewidth',1.5);

hold on;

plot(testdata,TY4,'r','linewidth',1.5);

axis([-11,11,-1.5,2]);

set(gca,'XTick',-11:1:11)

legend1=legend('Training data','Desired output','ELM','RELM','WRELM','ORELM');

set(legend1,'Position',[0.73 0.74 0.14 0.17]);

set (gcf,'Position',[0 0 880 610]);

saveas(gcf, 'Fig1_1.eps','psc2');

saveas(gcf, 'Fig1_1', 'fig');

save figure20_1;

⛄ 运行结果

⛄ 参考文献

[1] Zhang K ,  Luo M . Outlier-robust extreme learning machine for regression problems[J]. Neurocomputing, 2015, 151:1519-1527.

⛄ 完整代码

❤️部分理论引用网络文献,若有侵权联系博主删除

❤️ 关注我领取海量matlab电子书和数学建模资料

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值