目錄
一、資料集介紹
1.輸入資料(XRHJDataInput.mat)
2.目標資料(XRHJDataTarget.mat)
3.預測資料(newdata_pre18.mat)
二、模型訓練
1.訓練程序
2.Matlab程式代碼
三、網路訓練
四、模型性能
五、泛化輸出
1.newdata(開盤價,成交量)
2.BPoutput(收盤價、最高價、最低價)
一、資料集介紹
1.輸入資料(XRHJDataInput.mat)
開盤價(1)、成交量(2),共641行,2列,

2.目標資料(XRHJDataTarget.mat)
收盤價(1)、最高價(2)、最低價(3),共641行,3列,

3.預測資料(newdata_pre18.mat)
開盤價(1)、成交量(2),共18行,2列,

資料集:https://pan.baidu.com/s/1JqCpsVGcRXHZS3tL31DREw
提取碼:TTXS
二、模型訓練
1.訓練程序





2.Matlab程式代碼
% Solve an Input-Output Fitting problem with a Neural Network
% Script generated by Neural Fitting app
% Created 07-Oct-2021 22:50:17
%
% This script assumes these variables are defined:
%
% data - input data.
% dataTarget - target data.
load XRHJDataInput.mat
load XRHJDataTarget.mat
x = data';
t = dataTarget';
% Choose a Training Function
% For a list of all training functions type: help nntrain
% 'trainlm' is usually fastest.
% 'trainbr' takes longer but may be better for challenging problems.
% 'trainscg' uses less memory. Suitable in low memory situations.
trainFcn = 'trainlm'; % Levenberg-Marquardt backpropagation.
% Create a Fitting Network
hiddenLayerSize = 10;
net = fitnet(hiddenLayerSize,trainFcn);
% Setup Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
% Train the Network
[net,tr] = train(net,x,t);
% Test the Network
y = net(x);
e = gsubtract(t,y);
performance = perform(net,t,y)
% View the Network
view(net)
% Plots
% Uncomment these lines to enable various plots.
%figure, plotperform(tr)
%figure, plottrainstate(tr)
%figure, ploterrhist(e)
%figure, plotregression(t,y)
%figure, plotfit(net,x,t)
%泛化
load newdata_pre18.mat
x = newdata';%newdata
BPOutPut=sim(net,x)%
三、網路訓練






四、模型性能
performance = 0.0023
五、泛化輸出
1.newdata(開盤價,成交量)

2.BPoutput(收盤價、最高價、最低價)

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/337597.html
標籤:AI
