Naive Bayes Posterior Probability
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
julian eiler
am 24 Aug. 2017
Beantwortet: Don Mathis
am 29 Aug. 2017
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 Kommentare
Akzeptierte Antwort
Don Mathis
am 29 Aug. 2017
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Naive Bayes finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!