ClassMetrics: Get classification accuracy metrics

View source: R/aggregators.R

ClassMetricsR Documentation

Get classification accuracy metrics

Description

Get classification accuracy metrics

Usage

ClassMetrics(x, y)

Arguments

x

The true class memberships

y

The predicted class memberships

Value

A vector with the following accuracy metrics:

  • Accuracy: acc

  • Chance accuracy: chance_acc

  • Cohen's Kappa: kappa

  • Positive predictive value: ppv

  • Chance positive predictive value: chance_ppv

  • Kappa of the positive predictive value: kappa_ppv

  • Negative predictive value: npv

  • Chance negative predictive value: chance_npv

  • Kappa of the negative predictive value: kappa_npv

  • Sensitivity: sens

  • Specificity: spec

Author(s)

Sercan Kahveci

Examples

mymod <- glm(am ~ cyl + disp + hp,
             family="binomial", 
             data = mtcars)

newpred <- as.numeric(predict(mymod, 
                              data=mtcars,
                              type="response") > 0.5)

ClassMetrics(x=mtcars$am, y=newpred)


Spiritspeak/skMisc documentation built on April 12, 2025, 5:40 a.m.