Learn R Programming

emil (version 2.2.10)

roc_curve: Calculate ROC curves

Description

Calculate ROC curves

Usage

roc_curve(result, y, resample, class = levels(y), statistic = "probability")

# S3 method for roc_curve as.data.table(x, ...)

# S3 method for roc_curve as.data.frame(x, ...)

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

Arguments

result

Modeling results, as returned by evaluate.

y

True response vector used to create result.

resample

Resampling scheme used to create result.

class

The class of interest to create ROC-curves for.

statistic

The name of the statistic (as returned by the prediction function of the modeling procedure).

x

Roc curve object, as returned by roc_curve.

Value

A data frame of class “roc”.

Examples

Run this code
# NOT RUN {
# Generate some noisy data
my.data <- iris
my.data[1:4] <- my.data[1:4] + 2*rnorm(150*4)

# Train and evaluate some classifiers
procedure <- list(lda = modeling_procedure("lda"),
                  qda = modeling_procedure("qda"))
cv <- resample("crossvalidation", iris$Species, nrep=1, nfold=3)
result <- evaluate(procedure, my.data[-5], my.data$Species, resample=cv)

# Study the performance
select(result, fold=TRUE, method=TRUE, error="error")
roc <- roc_curve(result, my.data$Species, cv)
plot(roc)
# }

Run the code above in your browser using DataLab