Onehotencode function is giving more columns which are filled with zeros than the number of categories.
Show older comments
a = readtable("mushrooms.csv");
aa = categorical(table2array(a));
b = onehotencode(aa(:,1),2);
first column has 2 categories but function creates 23 columns. Which is also the total number of columns in variable a. Also other variables behave the same too and seemingly 2 spesific column in each onehotencoded variable has the true onehotencoded variables. Can you help me please?
Accepted Answer
More Answers (1)
Yagiz Dereboy
on 11 Sep 2021
0 votes
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!