How to optimise classification learner for a specific class

1 次查看(过去 30 天)
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 个评论
Ilya
Ilya 2018-2-28
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.

请先登录,再进行评论。

采纳的回答

Bernhard Suhm
Bernhard Suhm 2018-4-2
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 个)

Community Treasure Hunt

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

Start Hunting!

Translated by