天天看點

【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;

⛄ 運作結果

【ELM預測】基于離群魯棒極限學習機實作資料預測附matlab代碼

⛄ 參考文獻

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

⛄ 完整代碼

❤️部分理論引用網絡文獻,若有侵權聯系部落客删除

❤️ 關注我領取海量matlab電子書和數學模組化資料

繼續閱讀