フィルターのクリア

what is the value of predicted and actual?

4 ビュー (過去 30 日間)
MANIMEGALAI SELVARAJ
MANIMEGALAI SELVARAJ 2017 年 2 月 19 日
コメント済み: Monisha R 2021 年 10 月 7 日
function EVAL = Evaluate(ACTUAL,PREDICTED)
% This fucntion evaluates the performance of a classification model by
% calculating the common performance measures: Accuracy, Sensitivity,
% Specificity, Precision, Recall, F-Measure, G-mean.
% Input: ACTUAL = Column matrix with actual class labels of the training
% examples
% PREDICTED = Column matrix with predicted class labels by the
% classification model
% Output: EVAL = Row matrix with all the performance measures
idx = (ACTUAL()==1);
p = length(ACTUAL(idx));
n = length(ACTUAL(~idx));
N = p+n;
tp = sum(ACTUAL(idx)==PREDICTED(idx));
tn = sum(ACTUAL(~idx)==PREDICTED(~idx));
fp = n-tn;
fn = p-tp;
tp_rate = tp/p;
tn_rate = tn/n;
accuracy = (tp+tn)/N;
sensitivity = tp_rate;
specificity = tn_rate;
precision = tp/(tp+fp);
recall = sensitivity;
f_measure = 2*((precision*recall)/(precision + recall));
gmean = sqrt(tp_rate*tn_rate);
EVAL = [accuracy sensitivity specificity precision recall f_measure gmean];
  1 件のコメント
Monisha R
Monisha R 2021 年 10 月 7 日
What was the right code for this?

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2017 年 2 月 19 日
From the documenbtation:
% Input: ACTUAL = Column matrix with actual class labels of the training
% examples
% PREDICTED = Column matrix with predicted class labels by the
% classification model
I would assume that ‘matrix’ is ‘vector’ here. The ‘ACTUAL’ values are whatever the original classifications are, and the ‘PREDICTED’ the results of your classifier. The values likely depend on the original ‘correct’ classifications and your classifier output.
  31 件のコメント
Star Strider
Star Strider 2017 年 5 月 16 日
My pleasure.
Nowshin Jenny
Nowshin Jenny 2018 年 12 月 19 日
Dear sir, after using this command in my code for EEG signal classification, I got following error-
"Function definitions are not permitted in this context."
How can i solve it?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by