LarsRothkegel / randomforest-matlab

Automatically exported from code.google.com/p/randomforest-matlab
0 stars 0 forks source link

Class Probability #37

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi

I have a question regarding the output of RF classification. You use majority 
vote to assign a class label to a query. I was wondering is it possible to have 
the probability that the query belongs to a class rather than the class label?

Let me give you an example to better convey my meaning. Assume that we have 
three classes A, B, and C I'd like to see the probability that a query x 
belongs to class A, the probability that x belongs to B and the probability 
that x belongs to C. If each tree produces the class probabilities for query x, 
we can average the class probabilities to have the total class probabilities.

If the class label that your code assigns to the x is A it is reasonable to see 
higher probability for x belonging to A than other two classes.

Thanks,
Saleh

Original issue reported on code.google.com by m.saleh....@gmail.com on 11 May 2012 at 2:34

GoogleCodeExporter commented 8 years ago
note that each tree is fully grown so each test example will only be assigned a 
unique class label. now if you consider all trees in the forest you will have a 
vector of size ntree with the class labels which you can use to get the class 
probabilities

take a look at comment 1 in here
http://code.google.com/p/randomforest-matlab/issues/detail?id=12&can=1&q=probabi
lity

does that solve your issue?

Original comment by abhirana on 11 May 2012 at 4:42

GoogleCodeExporter commented 8 years ago
Yes, thanks a lot!

Original comment by m.saleh....@gmail.com on 11 May 2012 at 6:55