多维时序 | Matlab实现GRU-Adaboost和GRU多变量时间序列预测对比

多维时序 | Matlab实现GRU-Adaboost和GRU多变量时间序列预测对比

目录

预测效果



基本介绍

多维时序 | Matlab实现GRU-Adaboost和GRU多变量时间序列预测对比

模型描述

Matlab实现GRU-Adaboost和GRU多变量时间序列预测对比(完整程序和数据)

1.输入多个特征,输出单个变量;

2.考虑历史特征的影响,多变量时间序列预测;

4.csv数据,方便替换;

5.运行环境Matlab2018b及以上;

6.输出误差对比图。

程序设计

clike 复制代码
 
        (32,'OutputMode',"last",'Name','bil4','RecurrentWeightsInitializer','He','InputWeightsInitializer','He')
        dropoutLayer(0.25,'Name','drop2')
        % 全连接层
        fullyConnectedLayer(numResponses,'Name','fc')
        regressionLayer('Name','output')    ];

    layers = layerGraph(layers);
    layers = connectLayers(layers,'fold/miniBatchSize','unfold/miniBatchSize');
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
%% 训练选项
if gpuDeviceCount>0
    mydevice = 'gpu';
else
    mydevice = 'cpu';
end
    options = trainingOptions('adam', ...
        'MaxEpochs',MaxEpochs, ...
        'MiniBatchSize',MiniBatchSize, ...
        'GradientThreshold',1, ...
        'InitialLearnRate',learningrate, ...
        'LearnRateSchedule','piecewise', ...
        'LearnRateDropPeriod',56, ...
        'LearnRateDropFactor',0.25, ...
        'L2Regularization',1e-3,...
        'GradientDecayFactor',0.95,...
        'Verbose',false, ...
        'Shuffle',"every-epoch",...
        'ExecutionEnvironment',mydevice,...
        'Plots','training-progress');
%% 模型训练
rng(0);
net = trainNetwork(XrTrain,YrTrain,layers,options);
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
%% 测试数据预测
% 测试集预测
YPred = predict(net,XrTest,"ExecutionEnvironment",mydevice,"MiniBatchSize",numFeatures);
YPred = YPred';
% 数据反归一化
YPred = sig.*YPred + mu;
YTest = sig.*YTest + mu;
------------------------------------------------
版权声明:本文为CSDN博主「机器学习之心」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

参考资料

1\] http://t.csdn.cn/pCWSp \[2\] https://download.csdn.net/download/kjm13182345320/87568090?spm=1001.2014.3001.5501 \[3\] https://blog.csdn.net/kjm13182345320/article/details/129433463?spm=1001.2014.3001.5501

相关推荐
.30-06Springfield2 天前
利用人名语言分类案例演示RNN、LSTM和GRU的区别(基于PyTorch)
人工智能·pytorch·python·rnn·分类·gru·lstm
suixinm11 天前
LSTM、GRU 与 Transformer网络模型参数计算
gru·lstm·transformer
珺毅同学12 天前
ubuntu24.04+5090显卡驱动安装踩坑
linux·ubuntu·gru
机器学习之心22 天前
Transformer-GRU、Transformer、CNN-GRU、GRU、CNN五模型时序预测对比
cnn·gru·transformer·cnn-gru·transformer-gru·五模型时序预测对比
逻辑01 个月前
从认识AI开始-----解密门控循环单元(GRU):对LSTM的再优化
人工智能·gru·lstm
chuanauc1 个月前
RNN & GRU & LSTM 模型理解
rnn·gru·lstm
机器学习之心2 个月前
贝叶斯优化Transformer融合支持向量机多变量时间序列预测,Matlab实现
支持向量机·matlab·transformer·多变量时间序列预测
机器学习之心2 个月前
SHAP分析!Transformer-GRU组合模型SHAP分析,模型可解释不在发愁!
深度学习·gru·transformer·shap分析
拓端研究室TRL2 个月前
CNN-LSTM、GRU、XGBoost、LightGBM风电健康诊断、故障与中国银行股票预测应用实例
人工智能·神经网络·cnn·gru·lstm
禺垣2 个月前
AdaBoost算法的原理及Python实现
人工智能·python·算法·机器学习·数据挖掘·adaboost·集成学习