Learn R Programming

see (version 0.6.4)

plot.see_performance_roc: Plot method for ROC curves

Description

The plot() method for the performance::performance_roc() function.

Usage

# S3 method for see_performance_roc
plot(x, ...)

Arguments

x

An object.

...

Arguments passed to or from other methods.

Value

A ggplot2-object.

Examples

Run this code
# NOT RUN {
if (packageVersion("performance") > "0.7.0") {
  library(performance)
  data(iris)
  set.seed(123)
  iris$y <- rbinom(nrow(iris), size = 1, .3)

  folds <- sample(nrow(iris), size = nrow(iris) / 8, replace = FALSE)
  test_data <- iris[folds, ]
  train_data <- iris[-folds, ]

  model <- glm(y ~ Sepal.Length + Sepal.Width, data = train_data, family = "binomial")
  result <- performance_roc(model, new_data = test_data)
  result
  plot(result)
}
# }

Run the code above in your browser using DataLab