how to fix the following error-
Ältere Kommentare anzeigen
I'm using matlab 2015b version. i ve constructed a Multilayer perceptron model to predict the gender of a person. While testing the model i get the following error-Systems of struct class cannot be used with the "predict" command. Convert the system to an identified model first, such as by using the "idss" command. Error in maintest (line 55) label = predict(model,S); how to fix this error..
14 Kommentare
Walter Roberson
am 19 Okt. 2017
How many gender classes did you code for? A lot of people get the model badly wrong by failing to code at least 7 at absolute minimum.
Annie micheal
am 20 Okt. 2017
Walter Roberson
am 20 Okt. 2017
Two-class gender determination is like rolling a 6 sided dice, assigning Male if you get a 1, assigning Female if you get a 6, and returning FAIL for the other 4 cases. And sometimes the form of that FAIL is that the program crashes.
Anyhow, we can refer you to https://www.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html; if you post the code then someone might notice something more specific.
Annie micheal
am 20 Okt. 2017
Bearbeitet: Torsten
am 20 Okt. 2017
Annie micheal
am 25 Okt. 2017
Walter Roberson
am 25 Okt. 2017
Which MATLAB version are you using, and what shows up for
class(model)
?
if label==1
text_str='male';
else
text_str='female';
end
I have friends who are filing human rights complaints over that kind of logic, and based upon precedent are considered likely to win. not "male" is not the same thing as "female" !
Annie micheal
am 25 Okt. 2017
Walter Roberson
am 25 Okt. 2017
In your MainClassifier.mat file, how did you create the 'model' variable that is showing up as a struct? And which MATLAB version was used to create that .mat ? (If you happened to have created an object in a later version of MATLAB and tried to load it in an earlier version, it can show up as a struct.)
Annie micheal
am 25 Okt. 2017
Walter Roberson
am 25 Okt. 2017
Which function did you call, from which File Exchange or third-party contribution?
Annie micheal
am 25 Okt. 2017
Bearbeitet: Walter Roberson
am 25 Okt. 2017
Walter Roberson
am 25 Okt. 2017
predict() can be one of:
Computer Vision Toolbox:
- https://www.mathworks.com/help/vision/ref/imagecategoryclassifier.predict.html
- https://www.mathworks.com/help/vision/ref/vision.kalmanfilter.predict.html
Control System Toolbox:
Neural Network Toolbox:
- https://www.mathworks.com/help/nnet/ref/autoencoder.predict.html
- https://www.mathworks.com/help/nnet/ref/predict.html
Statistics and Machine Learning Toolbox:
- https://www.mathworks.com/help/stats/classificationkernel.predict.html
- https://www.mathworks.com/help/stats/classificationknn.predict.html
- https://www.mathworks.com/help/stats/compactclassificationdiscriminant.predict.html
- https://www.mathworks.com/help/stats/compactclassificationecoc.predict.html
- https://www.mathworks.com/help/stats/compactclassificationensemble.predict.html
- https://www.mathworks.com/help/stats/compactclassificationsvm.predict.html
- https://www.mathworks.com/help/stats/compactclassificationtree.predict.html
- https://www.mathworks.com/help/stats/compactgeneralizedlinearmodel.predict.html
- https://www.mathworks.com/help/stats/classificationlinear.predict.html
- https://www.mathworks.com/help/stats/compactclassificationensemble.predict.html
- https://www.mathworks.com/help/stats/compactclassificationnaivebayes.predict.html
- https://www.mathworks.com/help/stats/compactregressionensemble.predict.html
- https://www.mathworks.com/help/stats/compactregressiongp.predict.html
- https://www.mathworks.com/help/stats/compactregressiontree.predict.html
- https://www.mathworks.com/help/stats/compactlinearmodel.predict.html
- https://www.mathworks.com/help/stats/generalizedlinearmixedmodel.predict.html
- https://www.mathworks.com/help/stats/linearmixedmodel.predict.html
- https://www.mathworks.com/help/stats/naivebayes.predict.html
- https://www.mathworks.com/help/stats/nonlinearmodel.predict.html
- https://www.mathworks.com/help/stats/regressionlinear.predict.html
- https://www.mathworks.com/help/stats/repeatedmeasuresmodel.predict.html
- https://www.mathworks.com/help/stats/compactregressionsvm.predict.html
- https://www.mathworks.com/help/stats/treebagger.predict.html
SymBiology Toolbox:
System Identification Toolbox:
Text Analytics Toolbox:
Which of those were you intending that your predict() command invoke?
Annie micheal
am 26 Okt. 2017
Bearbeitet: Walter Roberson
am 26 Okt. 2017
Walter Roberson
am 26 Okt. 2017
Okay, that is progress.
The Neural Network predict() command requires either a
When I examine articles about MLP, I find that they are a non-cascaded Feed Forward Network, such as one might create with feedforwardnet() . However, feedforwardnet() is used for function approximation and clustering, and predict() is not applicable to such networks. Considering your purpose, I wonder if you would be better off with a <https://www.mathworks.com/help/nnet/ref/patternnet.html patternnet() for pattern recognition? Those do not use predict() either though.
The predict() for SeriesNetwork deals with networks that look fairly different in structure that MLP would have -- although possibly you could use such a network, it looks much more complicated than you need to me.
Anyhow, you have the fundamental problem that the third-party MLP training routine that you are using does not create a network structure that is in the form expected by any of the Neural Network Toolbox functions. If we could narrow down your needs, then possibly we could extract information from the training you did and use it to build something that could be used with the Neural Network toolbox.
... but I suspect that what you are supposed to do with the training structure you created is to call a third party routine to use it with. Certainly that would be the case if you are using http://3options.net/brainannex/multilayer-perceptron-in-matlab-octave/
Antworten (0)
Kategorien
Mehr zu Deep Learning Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!