
I made a patternnet, and i cannot understand what target values mean
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have a set of image feature data and i have made my target matrix as:
targets = zeros(3,900);
targets(1,1:300) = 1;
targets(2,301:600) = 1;
targets(3,601:900) = 1;
what would change if i changed the 1 values as:
targets = zeros(3,900);
targets(1,1:300) = 1;
targets(2,301:600) = 2;
targets(3,601:900) = 1;
can anyone explain me what is their role?
0 Commenti
Risposte (1)
Anshika Chaurasia
il 20 Gen 2021
Hi Sougles,
In the following code, the dataset labels/target/classes are in one-hot encoding format.
targets = zeros(3,900);
targets(1,1:300) = 1;
targets(2,301:600) = 1;
targets(3,601:900) = 1;
Looking at the shape of targets, there are 3 classes in your dataset.
Let's say there are three classses A, B and C. So, we will need three binary variables for one-hot encoding. A "1" value is place in the binary variable for the class and "0" for the other classes.

Hence,
targets(1,1:300) = 1; % samples 1 to 300 belong to first class
targets(2,301:600) = 1;% samples 301 to 600 belong to second class
targets(3,601:900) = 1;% samples 601 to 900 belong to third class
0 Commenti
Vedere anche
Categorie
Scopri di più su Deep Learning Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!