Accuracy Calculation using confusionmat?

3 ビュー (過去 30 日間)
shawin
shawin 2020 年 10 月 23 日
編集済み: shawin 2020 年 10 月 23 日
Kindly I have an issue with accuracy calculation, please could you help ?
y_train = [ 1 1 1 4 4 3 3 5 5 5 ]; % for x_train
%x_test : has no true labels.
predictedLabel=[ 1 2 3 4 5 ]; %predicted lables for x_test
I used the code below :
group=y_train ; % 10
grouphat=predictedLabel; % for test 5 test data
C=confusionmat(group,grouphat);
Accuracy = sum ( diag (C)) / sum (C (:)) ×100;
but get error:
Error using confusionmat (line 75)
G and GHAT need to have same number of rows
I had error since the test data is more or less than the train ( no lables)?
No true label for test data ( semi supervised learning )
Thank you

回答 (0 件)

カテゴリ

Help Center および File ExchangeHypothesis Tests についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by