How to use multiple labels as targets in Neural Net Pattern Recognition Toolbox?
6 次查看(过去 30 天)
显示 更早的评论
I am trying to use the Neural Net Pattern Recognition toolbox in MATLAB for recognizing different types of classes in my dataset. I have a 21392 x 4 table, with the columns 1-3 which I would like to use as predictors and the 4th column has the labels with 14 different categories (strings like Angry, Sad, Happy, Neutral etc.). It seems that the Neural Net Pattern Recognition toolbox, unlike the MATLAB Classification Learner toolbox doesn't allow me to import the table and automatically extract the predictors and responses from it. Moreover, I am unable to either specify the inputs and targets to the neural network manually as it isn't showing up in the options.
I looked into the examples like the Iris Dataset, Wine Dataset, Cancer Dataset etc., but all of them only have 2-3 classes as outputs which are being Identified and the labels are not string type unlike mine like Angry, Sad, Happy, Neutral etc. (total 14 different classes). I would like to know how I can use my table as input to the neural network pattern recognition toolbox, or otherwise, any way in which I can extract the data from my table and use it in the toolbox. I am new to using the toolbox, so any help in this regard would be highly appreciated. Thanks!
0 个评论
回答(2 个)
Greg Heath
2018-12-9
The following is standard for classification and pattern recognition:
1. Label the classes from 1 to 14
2. Use the columns of the 14-dimensional unit matrix eye(14) as columns of the target matrix
HOWEVER, BEFORE YOU START WITH YOUR DATA, DO THE FOLLOWING
1. Consider the examples used in the documentation
help patternnet
and
doc patternnet
2. Consider some of my posts in BOTH ANSWERS and COMP.SOFT.SYS.MATLAB
greg patternnet
*THANK YOU FOR FORMALLY ACCEPTING MY ANSWER*
Greg
RAJA SEKHAR BATTU
2022-10-17
编辑:RAJA SEKHAR BATTU
2022-10-27
I think I am very late to answer this question. But, I want to share the procedure I followed for my problem.
lets say we have 2000*3 matrix as input rows represent data for 10 classes with 200 each. coloumns represent features selected.
I think we can start with
first class second class third class ..............repeat for 10 classes
1 1 1 1 1 1 .....first(200) 0 0 0 0 0 0....... 0 0 0 0 0 0.......
0 0 0 0 0 0....... 1 1 1 1 1 1 .....next(200) 0 0 0 0 0 0.......
0 0 0 0 0 0....... 0 0 0 0 0 0....... 1 1 1 1 1 1 .....next(200)
0 0 0 0 0 0....... 0 0 0 0 0 0....... 0 0 0 0 0 0.......
0 0 0 0 0 0....... 0 0 0 0 0 0....... 0 0 0 0 0 0.......
0 0 0 0 0 0....... 0 0 0 0 0 0....... 0 0 0 0 0 0.......
0 0 0 0 0 0....... 0 0 0 0 0 0....... 0 0 0 0 0 0.......
0 0 0 0 0 0....... 0 0 0 0 0 0....... 0 0 0 0 0 0.......
0 0 0 0 0 0....... 0 0 0 0 0 0....... 0 0 0 0 0 0.......
0 0 0 0 0 0....... 0 0 0 0 0 0....... 0 0 0 0 0 0.......
This is the way of labelling(target matrix) the input matrix.
create two seprate matrices input and target. And also create a matlab script which can make the problem easy.
After labelling transpose this matrix for your case..
Thank you
Raja
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!