title: Get the accuracy of a random forest in R
body: <p>I have created a <code>random forest</code> out of my data: </p>
  
  <pre><code>fit=randomForest(churn~., data=data_churn[3:17], ntree=1,
                   importance=TRUE, proximity=TRUE)
  </code></pre>
  
  <p>I can easily see my <code>confusion matrix</code>: </p>
  
  <pre><code>conf &lt;- fit$confusion
  &gt; conf
       No Yes class.error
  No  945  80  0.07804878
  Yes  84 101  0.45405405
  </code></pre>
  
  <p>Now I need to know the accuracy for the random forest. I searched around and realized that <a href="http://cran.r-project.org/web/packages/caret/vignettes/caret.pdf" rel="noreferrer">caret</a> library has a <code>confusionMatrix</code> method that gets a confusion matrix and returns the accuracy (alongside with many other values). However, the method needs another parameter called <code>"reference"</code>. My question is how can I provide a reference for the method to get the accuracy of my random forest?
  And... is it the correct way to get the accuracy of a random forest? </p>