Learn R Programming

nestedcv (version 0.9.0)

plot.prc: Plot precision-recall curve

Description

Plots a precision-recall curve using base graphics. It accepts an S3 object of class 'prc', see prc().

Usage

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

Value

No return value

Arguments

x

An object of class 'prc'

...

Optional graphical arguments passed to plot()

See Also

prc()

Examples

Run this code
# \donttest{
if (requireNamespace("mlbench")) {
library(mlbench)
data(Sonar)
y <- Sonar$Class
x <- Sonar[, -61]

fit1 <- nestcv.glmnet(y, x, family = "binomial", alphaSet = 1, cv.cores = 2)
fit1$prc <- prc(fit1)  # calculate precision-recall curve

fit2 <- nestcv.train(y, x, method = "gbm", cv.cores = 2)
fit2$prc <- prc(fit2)

plot(fit1$prc)
lines(fit2$prc, col = "red")
}
# }

Run the code above in your browser using DataLab