How to find the classification Accuracy

Hello everyone.
I was working in below docuemntation, and I did run the code
But I couldn't know where the accuracy exactly ? I need it in percentage.
Also how could I find where is the model accuracy for the training and the accuracy for the testing.
Would you please help.
Thank you

댓글 수: 1

Athul Prakash
Athul Prakash 2019년 9월 25일
check the documentation for fitcsvm and you'll find your answers.
Especially refer to the section: Input Arguments > Hyperparameter Optimization Options
Not sure which parameter exactly you wanted, but I think I found a way by loggin Misclassification rates. Method is outlined in my answer below.

댓글을 달려면 로그인하십시오.

답변 (1개)

Athul Prakash
Athul Prakash 2019년 9월 25일

0 개 추천

Hi Noufal,
Here's how to log and MisclassificationRate and calculate Accuracy from there:
Where is the Misclassification Rate:
The 'objective Function' during minimization is actually the misclassification rate of the svm. These values are displayed in the output text, for each iteration separately.
To log those values:
By setting 'SaveIntermediateResults' property of 'opts' (HyperparameterOptimizationOptions) to true, fitcsvm will log information after every iteration - into a 'BayesianOptimization' object named 'BayesoptResults'.
After the process completes, examine the 'ObjectiveTrace' property of that object to view the record of objective function values for each iteration (these are the misclassification rates of the 30 different SVMs)
Percentage Accuracy
PercAcc = 100*(1-MisClassRate)
(I highly recommend going through the doc for Bayesian Optimization object - https://www.mathworks.com/help/stats/bayesianoptimization.html)
(Also check the 'Hyperparameter Optimization Options' section of the doc for fitcsvm function - https://www.mathworks.com/help/stats/fitcsvm.html)
Hope it Helps!

카테고리

질문:

2019년 9월 22일

댓글:

2019년 9월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by