MATLAB Answers

how to to evaluate accuracy score for a model in matlab

116 views (last 30 days)
SURENDRA BASKEY
SURENDRA BASKEY on 7 Nov 2019
Answered: Bhargavi Maganuru on 27 Dec 2019
I have build a decision tree model using matlab.Now i want to test my model with test data.so how can i test my model and calculate the accuracy of my model.thanks in advance

  6 Comments

Show 3 older comments
Walter Roberson
Walter Roberson on 7 Nov 2019
rms(y_true == y_predict)
for one definition of "accuracy". But there are other definitions, and you need to indicate which formula you need to use.
SURENDRA BASKEY
SURENDRA BASKEY on 7 Nov 2019
i think rms error is used for model like regression.my model is binary classification which predicts either 0 or 1.what i want to know is is there inbuilt fuction in matlab which takes y_true and y_predict and gives prediction accuracy based on no of correct prediction.thank you
Walter Roberson
Walter Roberson on 7 Nov 2019
No, there is no built-in function for that. "accuracy" is not well-enough defined in the situation for there to be a function for that.
If rms() does not do the job for you, you should probably looking at precision or recall rather than some not-defined accuracy .

Sign in to comment.

Answers (1)

Bhargavi Maganuru
Bhargavi Maganuru on 27 Dec 2019
You can use loss function to predict classes for the test data and to get accuracy of prediction.

  0 Comments

Sign in to comment.

Sign in to answer this question.


Translated by