title: How to change the threshold for binary classification
body: <p>I've trained a gbm model in R. Since I'm trying to predict a very rare case, I get a lot of false positives. I wanted to change the threshold for a positive ("Good") case from the default to 0.7. Here is my code so far.</p>
  
  <pre><code>modFit.glm.ml &lt;- train(as.factor(ml.training$one_lease)~., data=ml.training, method = "glm")
  confusionMatrix(ml.testing$one_lease, predict(modFit.glm.ml, ml.testing), positive = "Good")
  </code></pre>
  
  <p>This code works but it uses the default cutoff.
  Someone mentioned this is possible with the predict function, but I don't know how to do it.</p>