Learn R Programming

ROCit (version 2.1.1)

measureit.rocit: Performance Metrics of Binary Classifier

Description

This is an S3 method for object of class "rocit". It computes various performance metrics at different cutoff values.

Usage

# S3 method for rocit
measureit(x, measure = c("ACC", "SENS"), ... = NULL)

Value

An object of class "measureit", same as returned by measureit.default.

Arguments

x

An object of class "rocit" created with rocit.

measure

The performance metrics to be evaluated. See "Details" for available options.

...

NULL. Used for S3 generic/method consistency.

Details

This function calls measureit.default. From the components of "rocit" objects, it calculates the score and class variables internally. See measureit.default for other details and available options for measure argument.

See Also

measureit.default, print.measureit

Examples

Run this code
data("Diabetes")
logistic.model <- glm(as.factor(dtest)~chol+age+bmi,
                      data = Diabetes,family = "binomial")
class <- logistic.model$y
score <- logistic.model$fitted.values
rocit_object <- rocit(score = score, class = class)
# -------------------------------------------------------------
measure <- measureit(rocit_object, measure = c("ACC", "SENS", "FSCR"))
names(measure)
plot(measure$ACC~measure$Cutoff, type = "l")
plot(measure$TP~measure$FP, type = "l")

Run the code above in your browser using DataLab