フィルターのクリア

How to get prediction scores from exported Classification model

21 ビュー (過去 30 日間)
Jeremias Marttinen
Jeremias Marttinen 2021 年 5 月 20 日
回答済み: Shashank Gupta 2021 年 5 月 25 日
I have exported a decision tree model from the classification learner, and now I want to test the model with new data. I have used the
predictions = researchquestion2.predictFcn(T)
How can I now get the accuracy, AUC, and confusion matrix figures in similar way to the classification learner app?
Thank you!

回答 (1 件)

Shashank Gupta
Shashank Gupta 2021 年 5 月 25 日
Hi,
The ability to export figures from the Classification Learner App is not available in the Statistics and Machine Learning Toolbox as of now. But there are workaround, you can simply export the data and call out the function explicitly to generate the same plot.
After you exported the model, you can evaluate the model and get the prediction for test data. Confusion matrix can be found out simply by using confusionchart function. Below is the code for the reference.
% Accuracy.
accuracy = sum(YPred == YTest)/numel(YTest)
% Confusion Matrix.
confusionchart(YPred, YTest);
I hope this helps.
Cheers

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by