powered by
Checks and sets the positive class for binary classification in a tabular dataset.
set_positive_class(x, positive_class)
Tabular data of the same class as x, with the positive class set as the second level of the outcome factor.
x
Tabular data, i.e. data.frame, data.table, or tbl_df (tibble): Input dataset. The last column will be treated as the outcome variable.
Character scalar: The name of the positive class. Must be one of the levels of the outcome variable.
EDG
dat <- data.frame(x = rnorm(100), y = factor(sample(c("Case", "Control"), 100, replace = TRUE))) levels(dat[["y"]]) dat <- set_positive_class(dat, "Case") levels(dat[["y"]])
Run the code above in your browser using DataLab