roc_curve: Calculate ROC curves

Description Usage Arguments Value Author(s) Examples

View source: R/roc-curve.r

Description

Calculate ROC curves

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
roc_curve(result, y, resample, class = levels(y), statistic = "probability")

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

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

## S3 method for class '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.

...

Sent to as.data.frame or as.data.table.

Value

A data frame of class “roc”.

Author(s)

Christofer Bäcklin

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 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)

emil documentation built on Aug. 1, 2018, 1:03 a.m.

Related to roc_curve in emil...