Please explain the training set for neural network
2 ビュー (過去 30 日間)
古いコメントを表示
Below is the training set code from matlab example ( https://www.mathworks.com/matlabcentral/fileexchange/28684-electricity-load-and-price-forecasting-webinar-case-study?s_tid=FX_rc1_behav )
Can i know the details regarding the code?
trainInd = data.NumDate < datenum('2008-01-01');-------------how to get numdate ?
trainX = X(trainInd,:);--------------------------What function does this line do?
trainY = data.ElecPrice(trainInd);
disp(trainY)
what is the logic?how many hidden layers are used?Please explain
0 件のコメント
採用された回答
Walter Roberson
2020 年 10 月 19 日
how to get numdate ?
In the example there "Electricity Load Forecasting using Neural Networks" then you have to look at the first line of the example,
data = fetchDBLoadData('2004-01-01', '2008-12-31');
The code for that function is provided as part of the FEX contribution. It connects to a database and retrieves the data from there. So the data.NumDate information is being retrieved from a database.
What function does this line do?
The comparison on the line above
trainInd = data.NumDate < datenum('2008-01-01');
returns a logical vector, one result for every entry in data.NumDate, that is set to true if the date is before that particular datenum, and false otherwise.
trainX = X(trainInd,:);
is then doing logical indexing, selecting rows of X corresponding to NumDate entries that were before 2008.
what is the logic?
net = newfit(trainX', trainY', 20);
so newfit() is used to create the network. newfit() is documented to be newff() with a plotting function set.
how many hidden layers are used?
When you pass a non-empty value as the third parameter to newfit() or newff() then the number of hidden layers used is one more than the number of entries in the vector. 20 is a vector of length 1, so 2 hidden layers will be used, the first of which will be sized 20 and the second will be whatever size is required by the data.
4 件のコメント
Walter Roberson
2020 年 10 月 19 日
"Fitting" assumes that given the same inputs, that there is always the same output. That is not the case for price and load forecasting, which has to take into account trends.
The same applies for pattern recognition.
Time series is the only one of those that looks to me to have potential.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!