Could anyone help me how to solve the error stating Y must be a vector of categorical responses or a cell array of categorical response sequences.
40 ビュー (過去 30 日間)
古いコメントを表示
In my code Y is {3x1} cell
where Y{1,1}=12x1 double
Y{2,1}=12x2 double
Y{3,1}=12x3 double
Could anyone help me how should I change Y to a cell array of categorical response sequences.
0 件のコメント
回答 (2 件)
jaah navi
2021 年 6 月 20 日
1 件のコメント
Walter Roberson
2021 年 6 月 20 日
Sorry, No, that is not valid training information.
If XTrain is a numeric array, then YTrain must be a categorical vector with number of entries equal to the number of samples in XTrain.
If XTrain is a cell array of numeric arrays, then YTrain must be a cell array, and each entry must be a categorical vector with number of entries each to the number of samples in the corresponding XTrain cell.
YTrain corresponds to class labels: each training sample (no matter how many features it has) corresponds to exactly one class.
Your Y{2,1} is 12 x 2. That would imply that you have two classes for each of 12 samples, or else that you have 12 classes for each of two samples. Either way is not permitted.
参考
カテゴリ
Help Center および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!