How to predict or forecast values using NFTOOL?
Show older comments
I am a new user MATLAB. I am working on an internship project titled "Short-Term Load Forecasting". After training the network on NFTOOL, I want to input some data and find the forecast values. Please have a look at the auto-generated script. Request Greg or some expert to help me find a solution.
% Solve an Input-Output Fitting problem with a Neural Network % Script generated by NFTOOL % Created Wed Jun 12 13:10:22 IST 2013 % % This script assumes these variables are defined: % % houseInputs - input data. % houseTargets - target data.
%filename = 'C:\Users\admin\Desktop\Matlab Study\Study\Testpurpose1.xlsx'; %sheet = 1; %xlRange1 = 'A2:C37'; %xlRange2 = 'D2:D37';
%inputs = xlsread(filename, sheet, xlRange1); inputs = xlsread('C:\Users\admin\Desktop\Matlab Study\Study\Testpurpose1.xlsx', 1, 'A2:C37'); targets = xlsread('C:\Users\admin\Desktop\Matlab Study\Study\Testpurpose1.xlsx', 2, 'A2:A37'); inputs = inputs'; %load house_dataset; %inputs = houseInputs; %targets = houseTargets; %targets = xlsread(filename, sheet, xlRange2); targets = targets';
% Create a Fitting Network hiddenLayerSize = 15; net = fitnet(hiddenLayerSize);
% Setup Division of Data for Training, Validation, Testing net.divideParam.trainRatio = 70/100; net.divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100;
% Train the Network [net,tr] = train(net,inputs,targets);
% Test the Network outputs = net(inputs); errors = gsubtract(targets,outputs); performance = perform(net,targets,outputs);
%p= [0.9,0.9,0.9]; I want to test such inputs and forecast the values. % View the Network view(net); %sim(net,p);
% Plots % Uncomment these lines to enable various plots. figure, plotperform(tr) figure, plottrainstate(tr) figure, plotfit(net,inputs,targets) figure, plotregression(targets,outputs) figure, ploterrhist(errors)
1 Comment
Greg Heath
on 17 Jun 2013
1. Please format your post
2. The term forecast implies a time-series, a dynamic NN and the prediction of future outputs given past and/or current inputs. Do not use it if time delays are not involved. The preferred term for static NNs is predict.
3. I do not understand your problem... the house_dataset has a 13-dimensional input.
Answers (0)
Categories
Find more on Deep Learning Toolbox 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!