How to extract true positive and true negative rates from confusion matrix obtained using classification learner
11 次查看(过去 30 天)
显示 更早的评论
I used classification learner to produce confusion matrix. Large matrix does not show automatically numerical values on the figure itself. How to make matlab show all values (annotate) even if overlapping and second how can I extract information from this figure including true positive (TP), and false negative (FN) rates (without writing myself the whole code. When I export model I don't see those values in the workspace. I see only class probability and class count, but nothing that would point to FN and TP etc. Thank you for your help
0 个评论
采纳的回答
Mukul Rao
2017-7-19
Hi,
I believe there is a limit of 20 classes for labels to be displayed in the confusion matrix. There is an existing enhancement request in place to clarify this in our documentation. I have updated this ticket reflect your pain point as well.
To answer your second question, you can export your model from the app and then use its "predictFcn" to evaluate its response for the training data. You can then use this result along with the true class values as inputs for the "confusionmat" function to retrieve the confusion matrix.
confusionmat(Y_actual,trainedModel.predictFcn(TrainingData__as_used_in_app))
Please note that the results will be slightly different from what you see in the Classification Learner App because the app uses 5-fold cross-validation by default. The validation scheme only affects the way that Classification Learner computes validation metrics. The final exported model is always trained using the full data set.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Classification Learner App 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!