How to optimise classification learner for a specific class
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Azura Hashim
le 26 Fév 2018
Réponse apportée : Bernhard Suhm
le 2 Avr 2018
Hi,
Is it possible in the classification learner app to prioritise the accuracy for a specific class? For example, if I have two possible reponses: True and False; I would like to maximise the prediction accuracy for the True response. I do not care about the False prediction. This objective simply becomes minimising false True.
Also, how does the machine learning toolbox treat NaNs in the predictor? I wasn't able to find documentation on this.
Thank you.
1 commentaire
Ilya
le 28 Fév 2018
Re: This objective simply becomes minimising false True.
This cannot be possibly true. If your objective is really to minimize the number of false positives, classify all observations into the negative class. Then the number of positive classifications, including those that are false, will be zero.
Réponse acceptée
Bernhard Suhm
le 2 Avr 2018
You can apply a cost matrix to force the classifier to make fewer mistakes on a subset of your classes, even if they aren't very frequent. So in a two class problem, you can prioritize the accuracy of the first class by using a matrix like C = [0,10;1,0] which penalizes misclassifications of the first class by a factor of 10, and then pass that cost matrix to the training routine using the 'Cost' parameter, like
C = [0,10;1,1];
model = fitc...(training_data,'class','Cost',C,...)
Right now, you can't do this from within the ClassificationLearner app, you have to step back to the programmatic workflow (but you can export code for the model you were exploring in the app with the "Export Model" button).
NaNs are ignored in the data by default.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Classification Learner App dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!