How to get the posterior probability of a test sample under a specific classifier

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get the posterior probability of a test sample under a specific classifier

603061018
Hello,
I am using the A&O decomposition strategy to handle multiclass classification. One of the key step is to get the top  2 prediction result (ci, cj)  for a test instance from multiple classifiers. So, if I want to get the top 2 prediction result, I must know the posterior probability of this test sample under each classifier.
In the Weka API, How to directly get the posterior probabality of a test sample for each class under a  specific classifier?
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to: To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit
https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: How to get the posterior probability of a test sample under a specific classifier

Eibe Frank-2
Administrator
Are you talking about MultiClassClassifier? It has a method that gives you the required probabilities (one of the two for each classifier):

/**
 * Returns the individual predictions of the base classifiers
 * for an instance. Used by StackedMultiClassClassifier.
 * Returns the probability for the second "class" predicted
 * by each base classifier.
 *
 * @param inst the instance to get the prediction for
 * @return the individual predictions
 * @throws Exception if the predictions can't be computed successfully
 */
public double[] individualPredictions(Instance inst) throws Exception {



Ignore the reference to “StackedMultiClassClassifier”.

Cheers,
Eibe

> On 5/11/2019, at 8:55 PM, [hidden email] wrote:
>
> Hello,
> I am using the A&O decomposition strategy to handle multiclass classification. One of the key step is to get the top  2 prediction result (ci, cj)  for a test instance from multiple classifiers. So, if I want to get the top 2 prediction result, I must know the posterior probability of this test sample under each classifier.
> In the Weka API, How to directly get the posterior probabality of a test sample for each class under a  specific classifier?
> _______________________________________________
> Wekalist mailing list -- [hidden email]
> Send posts to: To unsubscribe send an email to [hidden email]
> To subscribe, unsubscribe, etc., visit
> https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to: To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit
https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html