After training my Neural Network, how do I use it?
2 views (last 30 days)
Show older comments
Hello
I used the Time Series Tool to generate a Script. I've placed as the input a 365x24 matrix (energy demand each hour for each day) and as the Target the same matrix but one-day forward.
My intention is that once the program is finished, I would place a 1x24 vector of the hourly demand energy and the program would give me its prediction 24 hours ahead (this means a 1x24 vector solution).
However, I was not able to figure out how can I use the script once the network has been trained.
Any help would be highly appreciated
0 Comments
Accepted Answer
Greg Heath
on 28 Aug 2014
The first thing you need to do is determine the significant lags of the autocorrelation function obtained from the training fraction (default is 0.7) of the 1x8760 hourly data.
Since you only have one series, the appropriate timeseries function is narnet. Use datadivisionFcn 'divideblock' instead of the silly 'dividerand' default.
Next determine how many hours ahead you want to predict at once. You seem to be thinking of a 24-dimensional input predicting a 24 dimensional output with a one hour sliding window. However, there are other lower dimensional possibilities that will be indicated by the significant lags determined above.
Use the form
[ net tr Ys Es Xf Af]= train(net,Xs,Ts,Xi,Ai);
So that predictions beyond your current data can be initialized with Xf and Af and continued in the closeloop mode.
You can search for some of my examples in the NEWSGROUP and ANSWERS using the search words
greg narnet closeloop
Hope this helps.
Thank you for formally accepting my answer
Greg
2 Comments
Greg Heath
on 30 Aug 2014
Single inputs (24x1) and outputs (24x1) are column vectors, not row vectors.
Do not use the dividerand default that destroys correlations.
More Answers (0)
See Also
Categories
Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!