分类预测 | MATLAB实现PCA-LSTM(主成分长短期记忆神经网络)分类预测

分类预测 | MATLAB实现PCA-LSTM(主成分长短期记忆神经网络)分类预测

预测效果

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

基本介绍

MATLAB实现PCA-LSTM(主成分长短期记忆神经网络)分类预测。Matlab实现基于PCA-LSTM主成分分析-长短期记忆神经网络多输入分类预测(完整程序和数据)
基于主成分分析-长短期记忆神经网络分类预测,PCA-LSTM分类预测,多输入分类预测(Matlab完整程序和数据)
输入多个特征,可用于二分类及多分类模型,可视化展示分类准确率。
运行环境Matlab2018及以上。

程序设计

%% LSTM层设置,参数设置
inputSize  = size(inputn_train,1);   %数据输入x的特征维度
outputSize = size(outputn_train,1);  %数据输出y的维度  
numhidden_units=240;
%% lstm
%输入层设、学习层、全连接层
layers = [ ...
    sequenceInputLayer(inputSize)                
    fullyConnectedLayer(2*inputSize)
    lstmLayer(numhidden_units)                 
    dropoutLayer(0.2)
    fullyConnectedLayer(outputSize)             
    regressionLayer];
%% trainoption(lstm)
%优化算法、训练次数、梯度阈值、运行环境、学习率、学习计划
opts = trainingOptions('adam', ...
    'MaxEpochs',800, ...
    'MiniBatchSize',48,...
    'GradientThreshold',1,...
    'ExecutionEnvironment','gpu',...
    'InitialLearnRate',0.005, ...
    'LearnRateSchedule','piecewise', ...
    'LearnRateDropPeriod',100, ...              
    'LearnRateDropFactor',0.8, ...
    'Verbose',0, ...
    'Plots','training-progress'... 
    );

参考资料

[1] https://blog.csdn.net/kjm13182345320/article/details/120498871?spm=1001.2014.3001.5501
[2] https://blog.csdn.net/kjm13182345320/article/details/120525662?spm=1001.2014.3001.5501
[3] https://blog.csdn.net/kjm13182345320/article/details/120406657?spm=1001.2014.3001.5501
[4] https://mianbaoduo.com/o/bread/mbd-YZyblpxy

致谢

  • 大家的支持是我写作的动力!!

猜你喜欢

转载自blog.csdn.net/kjm13182345320/article/details/132748332