Deep Neural Network Training (Non-Image Classification)

1 view (last 30 days)
Dear MATLAB Community,
I'm tying to train a Neural Network for Non-Image Classification task:
  • I have a table 30x14 called Dataset containing 13 Columns which are the Features and the last column (14th) has the labels.
  • Each Row in Dataset is one example.
  • I also have the features saved as a 30x13 Matrix called "features" containg the features and a 30x1 Matrix called "labels" containing the labels.
  • I also build an architecture using Deep Neural Network Designer Application in MATLAB and saved my architecture in a variable called "layers".
  • I need to build and train a neural network for classifying future examples and assess the accuray of my model.
  • I have options set as
options = trainingOptions('sgdm', ...
'MaxEpochs',20,...
'InitialLearnRate',1e-4, ...
'Verbose',false, ...
'Plots','training-progress');
Attempts:
(1) net = trainNetwork(Dataset,layers,options)
(2) net = trainNetwork(features,labels,layers,options)
Both attemps failed and gave errors
(1)
Error using trainNetwork (line 165)
Invalid training data table for classification. Predictors must be in the first column of
the table, as a cell array of image paths or images. Responses must be after the first
column, as categorical labels.
(2)
Error using trainNetwork (line 165)
Too many input arguments.
Caused by:
Error using trainNetwork>iParseInputArguments (line 290)
Too many input arguments.
Anyone has any idea what to do ?
Thank You

Answers (1)

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH on 14 Nov 2019
For your problem I recommend that you use patternnet
example:
[x,t] = iris_dataset; %x is 4x150 (4 features,150 samples) , y is 3x150 (3 total labels,150 samples)
net = patternnet(10);%create net
net = train(net,x,t);%train net
view(net)
y = net(x);%evaluate net
perf = perform(net,t,y);%test performance
classes = vec2ind(y);%all net outputs
futureclassification=vec2ind(net([6.7 3.1 5.6 2.4]'))%your future data here

Categories

Find more on Image Data Workflows in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!