# Probabilites in Random Forest Prediction

I am using Random Forest to classify my data into 2 classes.

After building the model, prediction is performed with type="prob" which throws the probability matrix which has the probability of each record belonging to each class.

My question is whether it is possible that the classifier throws equal probabilities for the two classes.

Example class1: 0.5 class2: 0.5

If abovementioned scenario is possible which class should we consider?

Suppose you're thinking of the R implementation of randomForest. Ties during prediction can occur.

The solution to this problem can be found in lines 589:593 of the source file "rf.c"

/* Break ties at random: */
if (crit == cmax) {
if (unif_rand() < 1.0 / ntie) jet[n] = j + 1;
ntie++;
}


..and citing from help file ?predict.randomForest: "NOTE2: Any ties are broken at random, so if this is undesirable, avoid it by using an odd number of trees (ntree) in randomForest()."

• Note that the "odd number of trees" trick expressly assumes a binary classification problem, such as the one that OP presented.
– Sycorax
Sep 14, 2015 at 17:11