I want to compute the AUC for a model.
library(yardstick)
data(two_class_example)
This code works.
roc_auc(
two_class_example,
truth = truth,
Class1,
options = list(smooth = TRUE)
)
I like to specify arguments so that my code is easier to read and debug.
roc_auc(
two_class_example,
truth = truth,
estimate=Class1,
options = list(smooth = TRUE)
)
This gives the following error
Error in metric_summarizer(metric_nm = "roc_auc", metric_fn = roc_auc_vec, : formal argument "estimate" matched by multiple actual arguments
Please explain this error. I thought the Class1 column is the vector of estimated class probabilities.
According to the help page for the function, the Class1 variable falls in the ...
argument, not the estimate argument (in fact, no such argument appears to exist). About the ...
, it reads:
A set of unquoted column names or one or more dplyr selector functions to choose which variables contain the class probabilities. If truth is binary, only 1 column should be selected. Otherwise, there should be as many columns as factor levels of truth.
Basically, there's no argument for you to worry about specifying.