summary.mccf1 {mccf1}R Documentation

Summarize the the performance of a binary classification using MCC-F1 metric and the best threshold

Description

'summary.mccf1()' calculates the MCC-F1 metric and the best threshold for a binary classification.

Usage

## S3 method for class 'mccf1'
summary(object, digits, bins = 100, ...)

Arguments

object

S3 object of class "mccf1" object resulting from the function 'mccf1()'

digits

integer, used for number formatting with signif

bins

integer, representing number of bins used to divide up the range of normalized MCC when calculating the MCC-F1 metric (default = 100L)

...

other arguments ignored (for compatibility with generic)

Value

data.frame that shows the MCC-F1 metric (in the range [0,1]) and the best threshold (in the range [0,1])

Examples

response <- c(rep(1L, 1000L), rep(0L, 10000L))
set.seed(2017)
predictor <- c(rbeta(300L, 12, 2), rbeta(700L, 3, 4), rbeta(10000L, 2, 3))
## Not run: summary(mccf1(response, predictor))
# mccf1_metric best_threshold
#    0.3508904       0.786905
summary(mccf1(response, predictor), bins = 50)
# mccf1_metric best_threshold
#    0.3432971       0.786905
## Not run: summary(mccf1(response, predictor), digits = 3)
# mccf1_metric best_threshold
#    0.351          0.787

[Package mccf1 version 1.1 Index]