Does anyone know how to perform a decision curve analysis for a random forest? I could not find any codes on the internet, even though i read papers that report this. I used the caret package to create my model and thought maybe through the predict function i could get the necessary information, however, this does not work. Really appreciate any help, especially as there seems to be no information available!
This is what i tried (model was tuned before)
tunegrid <- expand.grid(.mtry=mtry)
model <- train(
Lymph_node_involvement ~ predictors,
data = train.data,
method = "rf",
ntree = 800,
preProcess = c("scale", "center"),
tuneGrid = tunegrid,
trControl = trainControl(
method = "cv",
summaryFunction = twoClassSummary,
classProbs = T,
savePredictions = T,
),
importance = TRUE,
metric = "ROC"
)
LNIClasses <- predict(model, newdata = test.data, type="raw")
LNIClasses <- as.data.frame(LNIClasses )
result2 = dca(data="test.data", outcome="Lymph_node_involvement", predictors="LNIClasses ", smooth="TRUE", xstop=0.50)``