필터 지우기
필터 지우기

How to optimise classification learner for a specific class

조회 수: 4 (최근 30일)
Azura Hashim
Azura Hashim 2018년 2월 26일
답변: Bernhard Suhm 2018년 4월 2일
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개)

카테고리

Help CenterFile Exchange에서 Classification Learner App에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by