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
답변 (0개)
참고 항목
카테고리
Help Center 및 File 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!