How to PREDICATE data using ANN toolbox?

2 次查看(过去 30 天)
Dear friends, My question is simple. How to predicate data with ANN? My data is like this:
1, 999919
2, 999824
3, 999730
4, 999635
5, 999540
6, 999445
7, 999350
8, 999255
9, 999160
...
data = xlsread('data.xlsx');
targets = data(:,2);
targets_train = targets(1:900);
targetSeries = tonndata(targets_train,false,false);
feedbackDelays = 1:5;
hiddenLayerSize = 30;
net = narnet(feedbackDelays,hiddenLayerSize);
net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
[inputs,inputStates,layerStates,targets] = preparets(net,{},{},targetSeries);
net.divideFcn = 'dividerand';
net.divideMode = 'time';
net.divideParam.trainRatio = 85/100;
net.divideParam.valRatio = 10/100;
net.divideParam.testRatio = 5/100;
net.trainFcn = 'trainlm';
net.performFcn = 'mse';
net.plotFcns = {'plotperform','plottrainstate','plotresponse', 'ploterrcorr', 'plotinerrcorr'};
[net,tr] = train(net,inputs,targets,inputStates,layerStates);
outputs = net(inputs,inputStates,layerStates);
errors = gsubtract(targets,outputs);
performance = perform(net,targets,outputs)
trainTargets = gmultiply(targets,tr.trainMask);
valTargets = gmultiply(targets,tr.valMask);
testTargets = gmultiply(targets,tr.testMask);
trainPerformance = perform(net,trainTargets,outputs)
valPerformance = perform(net,valTargets,outputs)
testPerformance = perform(net,testTargets,outputs)
I want to forecast what is 901st data? How?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by