How to calculate the AUC value for a ranger RF model ?
2
0
Entering edit mode
7.3 years ago
debitboro ▴ 270

Hi Biostars community,

How can I calculate the AUC value for a ranger model ? Ranger is a fast implementation of randomForest algorithm in R. I'm using the following code to build the ranger model for classification purposes, and get the prediction from the model:

#Build the model using ranger() function
ranger.model <- ranger(formula, data = data_train, importance = 'impurity', write.forest = TRUE, num.trees = 3000, mtry = sqrt(length(currentComb)), classification = TRUE)
#get the prediction for the ranger model
pred.data <- predict(ranger.model, dat = data_test,)
table(pred.data$predictions)

But I dont know how to calculate the AUC value

Any idea ?

AUC value ranger randomForest classification • 4.9k views
ADD COMMENT
0
Entering edit mode
5.5 years ago
Researcher ▴ 130

Hi debitboro, By any chance, did you get this answer?

ADD COMMENT
0
Entering edit mode
3.2 years ago
dao • 0

Hi debitboro, you can try the following code.

rocRFall=roc(as.factor(pre.label),pred.data)
aucRF=pROC::auc(rocRFall)
print(aucRF)
ADD COMMENT

Login before adding your answer.

Traffic: 1785 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6