I am using matlab r2010a to design a neural network to model 13,440 samples of numeral data of 3 input variables and 1 target. When i try to train, i get the following message;Targets are incorrectly sized for network. Matrix must have 3 columns
1 view (last 30 days)
Show older comments
The following is the code i have used;
Data_Inputs = xlsread('tvdiary10080.xlsx'); Testing_Data = xlsread('tvdiary3360.xlsx'); Shuffling_Inputs = Data_Inputs(randperm(10080),1:4); Training_Set = Shuffling_Inputs(1:10080,1:3)% specify training set [1st - 21st] Target_Set = Shuffling_Inputs(1:10080,4) % specify target set [22nd – 28th] Testing_Set = Testing_Data(1:3360,1:3) % specify Testing set [1st - 21st] Testing_Target_Set = Testing_Data(1:3360,4) % specify Testing set, Target [22nd – 28th] [pn, ps] = mapstd(Training_Set); [tn, ts] = mapstd(Target_Set); MyNetwork = newff (pn,tn, [20] , {'logsig'}); MyNetwork.trainFcn = 'trainlm'; MyNetwork.trainparam.min_grad = 0.00000001; MyNetwork.trainParam.epochs = 1000; MyNetwork.trainParam.lr = 0.4; MyNetwork.trainParam.max_fail =20; %MyNetwork= newrb(pn,tn,goal,spread, mn, df); MyNetwork = train(MyNetwork,pn,tn); save(NetworkName,'MyNetwork'); y = sim(MyNetwork, testn); % simulate network y_again = mapstd('reverse',y, targets) % denormlized %Daily_Result = performance(y,t,'all', 'v') % calculate statstics
What am i doing wrong?
0 Comments
Accepted Answer
Greg Heath
on 28 Mar 2013
1. Learn how to format your submissions e.g., indent equations 1 space
2. Transpose your matrices (as explained in the documentation)
Thank you for formally accepting my answer
Greg
More Answers (1)
See Also
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!