I made a patternnet, and i cannot understand what target values mean

2 ビュー (過去 30 日間)
SOUGLES STAMATIS
SOUGLES STAMATIS 2021 年 1 月 12 日
回答済み: Anshika Chaurasia 2021 年 1 月 20 日
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?

回答 (1 件)

Anshika Chaurasia
Anshika Chaurasia 2021 年 1 月 20 日
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

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by