How to identify the class is labeled or not? help me in finding target matrix??

2 views (last 30 days)
sorry for this silly question. actually, I want to classify a 2D data which I obtained after performing some operation. now I have to classify this data using patternnet. for that, i want a "target matrix".please help me in this. I have 51 classes in my dataset.
here i have a matrix of size 7701*51. now i want to classify this matrix in 51 classes(as these many individuals i have in the dataset). please help me, how can i generate target matrix if i want to do classification using nprtool.
user06 on 18 Dec 2017
sir i have 51 classes and each class contains 300 samples. i have extracted features using CNN. the result of the CNN has the size 7701*51(as i have divided 151 images for training and 149 for testing). now i want to do classification using nprtool. for that i have to provide target matrix. and i am unable to understand how can i generate that target matrix.

Sign in to comment.

Answers (1)

Greg Heath
Greg Heath on 18 Dec 2017
Edited: Greg Heath on 29 Dec 2017
If you have N I-dimensional input vectors to classify into one of c independent classes, the size of the input matrix is
[ I N ] = size(input)
corresponding to a target matrix with N c-dimensional 0-1 unit sum vectors
[ c N ] = size(target)
that yields
sum(target) = ones(1,N)
From the info in the question,
c = 51
N = 51*300 = 15,300
Therefore the target matrix has columns from eye(51) with 50 zeros and the single "1" indicates the class.
However, it is not clear from the description what I (the size of the input vectors) is supposed to be.
Hope this helps
Thank you for formally accepting my answer

Community Treasure Hunt

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

Start Hunting!