I am using the r package caret and ranger to develop a classifier to predict the risk of dying, but I am having trouble calculating AUC:
I am aware that I need to set probability = TRUE when training the model, however, I get an error, and I cant run the model.
My code (I work from a remote server that doesn't allow for me to copy from it, so I will write it out manually):
set.seed(40) control.data <- trainControl(method="cv", number=10, sampling ="up", VerboseIter= TRUE) rfGrid <- expand.grid( .mtry=2:6, .splitrule="gini", .min.node.size=c(500)) fit.dataup <- train(mort_30 ~ C_SEX+V_AGE+Hemoglobin+Thrombocytes+Leukocytes+CRP, data=data.train, method="ranger", max.depth=10, num.trees=500, trControl=control.data, tuneGrid=rfGrid, importance="impurity", probability = TRUE, verbose=TRUE)
Then I get this error message when trying to run it:
Model fit failed for Fold01: mtry=2, splitrule=gini, min.node.size=500 Error in ranger::ranger(dependent.variable.name = ".outcome", data =x,: formal argument "probability" matched by multiple actual arguments
What am I doing wrong?