I am having trouble calculating ROC score (AUC) using gbm package. I am working with boosted regression trees. The script I am running is:
testing.tc5.lr005 <- gbm.step(data=ModelData,
gbm.x = 3:4,
gbm.y = 2,
family = "gaussian",
tree.complexity = 5,
learning.rate = 0.005,
bag.fraction = 0.5)
It should produce "training data ROC score" and "cross validation ROC score" along with other correlation parameters. I do not get ROC scores. I called names(testing.tc5.lr005). It lists cv.roc.matrix but produces the following if I call testing.tc5.lr005$cv.roc.matrix:
[1] 0 0 0 0 0 0 0 0 0 0
I tried calculating ROC AUC by roc(TestData$TN,predTN) (TestData~data used for prediction i.e. observed values; predTN~predicted values). It results in [1]NA. I have no clue what I am doing wrong, although rest of model seems to be doing good with reasonable testing and CV correlation and SE values.
Any pointers about where I am wrong or an alternate would be really appreciated!
Thanks
First of all, I think you are using the gbm package in conjunction with the dismo package. As Calimo said, gbm.step does not exist outside dismo.
I can't answer your question of HOW to calculate ROC (I'm no expert--I had the same question and that's how I got here), but I can tell you that dismo won't calculate it. I took a look at the code in the dismo package and it appears that they do not allow ROC calculation for the gaussian family.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With