summary.mccf1: Summarize the the performance of a binary classification...

Description Usage Arguments Value Examples

View source: R/mccf1.R

Description

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

Usage

1
2
## 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

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

Example output

Loading required package: ggplot2
 mccf1_metric best_threshold
    0.3432971       0.786905

mccf1 documentation built on Nov. 12, 2019, 1:07 a.m.

Related to summary.mccf1 in mccf1...