Manipulate Random forest to produce a score rather than 0/1 label
<p>Here is my situation: I am able to use <code>random forest</code> to do binary classification problem; note that given a feature vector, a typical <code>random forest</code> model can predict whether it is belonging to group <code>1</code> or group <code>0</code>, thus making a binary classification.</p>

<p>However, due to multiple reasons, for each feature vector, I want to have a score ranging from 0 to 1 instead of the <code>0/1</code> label. Idealy, the higher the score is, I have more confidence that the feature vector should be put into the <code>1</code> set, otherwise, it should belong to the <code>0</code> set. </p>

<p><strong>So it is still a <code>0/1</code> classification, but this time, I want to have a score ranging from 0 to 1, instead of the <code>0</code> or <code>1</code> label.</strong></p>

<p>I was told that some statistic classification method, such as <code>naive Bayes</code>, can generate the possibility score, representing whether a given feature vector should be put into <code>0</code> set or <code>1</code> set. However, I did a quick 10-fold validation using <code>naive Bayes</code> on my data set, and comparing with <code>random forest</code>, the performance looks very bad.</p>

<pre><code>                precision    recall 
random forest   0.901        0.907
naive  Bayes    0.752        0.653
</code></pre>

<p>Too bad... I want to keep the high performance of <code>random forest</code>, as well as acquring a <code>score</code>.. </p>

<p>I am aware that <code>random forest</code> has a special tree-like structure, and as a newbie to machine learning, I have no idea how to manipulate <code>random forest</code> to generate the score. </p>

<p>So here is my question, how manipulate <code>random forest</code> to generate a score ranging from 0 to 1, instead of the <code>0</code> or <code>1</code> label, given a feature vector sample? Am I clear enough? Thank you!</p>