Description Usage Arguments Value Examples
Plots the gain curve for evaluating a trained classification model.
1 2 3 |
mapping |
Set of aestetic mappings. Required aesthetics are 'score' and 'class'. Further aestetics that can be set are the 'fill_color' and the 'fill_alpha'. |
data |
The data to be displayer in this layer. |
positive_class |
character indicating the "positive" class of interest. |
ggplot
1 2 3 4 5 6 7 8 9 10 11 12 | library(dplyr)
library(mlbench)
data("BreastCancer")
my_data <- BreastCancer %>%
mutate(Cell.size = as.numeric(Cell.size)) %>%
select(Cell.size, Class)
fit <- glm(Class ~ ., data = my_data, family = "binomial")
my_data$pred <- predict(fit, newdata = my_data)
my_data %>%
ggplot(aes(score = pred, class = Class)) +
geom_gain(positive_class = "malignant")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.