Naive Bayes Posterior Probability
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I am using a Naive Bayes Classifier which I train with:
Mdl = fitcnb(data,target,...
'Holdout',0.10,...
'OptimizeHyperparameters','auto',...
'HyperparameterOptimizationOptions',...
struct('AcquisitionFunctionName','expected-improvement-plus'));
So when I predit the class of the data results in values of 0 and 1, because I only have two classes. This is pretty nice, but I need to know the certainty of this estimate. So I want to have something like:
class 1: probability 0.4
class 2: probability 0.6
or something like this.
Is the correct function for this the posterior function? As far as I understood it this function is only available for the deprecated NaiveBayes class.
Does anybody know how I can get the probability of the estimate?
댓글 수: 0
채택된 답변
Don Mathis
2017년 8월 29일
You can get the posterior probabilities from the second output of the predict method. See this page: http://www.mathworks.com/help/stats/compactclassificationnaivebayes.predict.html
[label,Posterior] = predict(Mdl,X)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Naive Bayes에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!