View source: R/utils_supervised.R
| set_positive_class | R Documentation |
Checks and sets the positive class for binary classification in a tabular dataset.
set_positive_class(x, positive_class)
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. |
positive_class |
Character scalar: The name of the positive class. Must be one of the levels of the outcome variable. |
Tabular data of the same class as x, with the positive class set as the second level of the outcome factor.
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"]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.