MATLAB Answers

How to predict future data after training the ANN?

조회 수: 14(최근 30일)
Ali Saremi
Ali Saremi 2017년 8월 27일
답변: Greg Heath 2017년 9월 11일
Hi,
My name is Ali. I have trained my network with my input data (wind Speed) and output data (Wave Height) and got good results. Also, i have my future data (Wind Speed) obtained from GSM from 2080 to 2100, so eveything is ready to perdict wave heights from 2080 to 2100. Please take a look at the screen shot attached to see what the codes are. If someone can help me how i can do the final stage, I would really apperciate it.
Kind Regards Ali

채택된 답변

Greg Heath
Greg Heath 2017년 8월 27일
%Just relying on default values:
x = annInput';
t = annTarget';
net = fitnet;
[net tr y e ] = train(net,x,t);
MSE = mse(e)
% Can obtain trn, val and tst subset indices from tr
% to obtain subsets of y and e and corresponding MSEtrn
% MSEval, MSEtst
%
% For arbitrary X
Y = net(X);
HOWEVER ...
DEFAULTS H=10 AND rng = RNG('DEFAULT') ARE OFTEN INNAPPROPRIATE!!!
In general, use a search for the smallest successful H (for stability) and
corresponding set of random initial weights.
I use a double for loop approach over the outer loop H = Hmin:dH:Hmax and
inner loop i = 1:Ntrials over random number states to find initial weights that will
yield a sufficiently small value of MSE.
Zillions of examples have been posted on both NEWSGROUP and ANSWERS. Good search words are
Greg Hmin Hmax
Thank you for formally accepting my answer
Greg
  댓글 수: 1
lior niss
lior niss 2017년 9월 11일
Hello Greg,
I saw that there were similar questions here, but I could not find a simple answer. I am looking a basic and simple answer. This is my problem : I need to predict stocks targets based on sequential features. I have samples of 595 different cases over 4638 times. For each time sample I have 179 features and a single target. The values of the features and targets are real values between -1.5 to 1.5. I tried number of algorithms, without success and now I'm trying to apply a neural network with Time series app . I train the data using Levenberg-Marquardt and after the training I save the results and I chose the option generate the script. So the question is: after I did training and got a model for my net , How do I get the prediction for another 1000 samples ( each sample is contains 179 features)? How should I use the model I have already created for the prediction problem?
Thank you

댓글을 달려면 로그인하십시오.

추가 답변(1개)

Greg Heath
Greg Heath 2017년 9월 11일
The first thing you need to do is throw away as many redundant inputs as possible.
I'm not sure of the best way to do it. However, It really is not necessary to find the optimum combination; just a good one.
I would start with 10 simple linear input reduction models using PLSREGRESS and 10 subsets with ~ 18 inputs each.
Hope this helps.
Greg

Community Treasure Hunt

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

Start Hunting!

Translated by