Maximize Recall using Caret package

I am using caret package to fine tune parameters of parameter models. I would like to fine tune the model in order to maximize recall or sensitivity

Is there any direct argument, that I can use? Do I need to develop a custom function?

Upvotes: 1

Views: 754

Answers (1)

Stelios
Stelios

Reputation: 11

In the trainControl function, specify classProbs = TRUE and summaryFunction = twoClassSummary. Then, in the train function specify the metric = "Sens".

For instance:

ctrl <- trainControl(method = "repeatedcv", repeats = 3, number = 10, classProbs = TRUE, summaryFunction = twoClassSummary)
grid <- expand.grid(mtry = c(3,4,5))

model <- train(Churn.Status ~ ., data = train_set, method = "rf", tuneGrid = grid, trControl = ctrl, metric="Sens")

Upvotes: 1

Related Questions