https://github.com/m-clark/confusionmatrix
Report various statistics stemming from a confusion matrix in a tidy fashion. 🎯
https://github.com/m-clark/confusionmatrix
balanced-accuracy confusion-matrix dice-coefficient f1-score fallout false-discovery-rate false-negative-rate false-omission-rate false-positive-rate kappa negative-predictive-value peirce positive-predictive-value precision-recall rand sensitivity specificity tidy true-negative-rate true-positive-rate
Last synced: about 1 month ago
JSON representation
Report various statistics stemming from a confusion matrix in a tidy fashion. 🎯
- Host: GitHub
- URL: https://github.com/m-clark/confusionmatrix
- Owner: m-clark
- License: other
- Created: 2019-09-12T16:29:37.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-10T17:10:07.000Z (almost 5 years ago)
- Last Synced: 2025-04-30T07:53:53.537Z (about 1 month ago)
- Topics: balanced-accuracy, confusion-matrix, dice-coefficient, f1-score, fallout, false-discovery-rate, false-negative-rate, false-omission-rate, false-positive-rate, kappa, negative-predictive-value, peirce, positive-predictive-value, precision-recall, rand, sensitivity, specificity, tidy, true-negative-rate, true-positive-rate
- Language: R
- Homepage: https://m-clark.github.io/confusionMatrix/
- Size: 432 KB
- Stars: 11
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output:
github_document
encoding: 'UTF-8'
---```{r, include = FALSE}
knitr::opts_chunk$set(
fig.path = "man/figures/",
comment = NA
)
```[](https://github.com/m-clark/confusionMatrix/actions)
[](https://codecov.io/gh/m-clark/confusionMatrix?branch=master)
[](https://www.tidyverse.org/lifecycle/#experimental)
# confusionMatrix
Given predictions and a target variable, provide numerous statistics from the resulting confusion matrix. The goal is to provide a wealth of summary statistics that can be calculated from a single confusion matrix, and return **tidy** results with as few dependencies as possible.
```{r demo}
library(confusionMatrix)p = sample(letters[1:2], 250, replace = T, prob = 1:2)
o = sample(letters[1:2], 250, replace = T, prob = 1:2)result = confusion_matrix(
prediction = p,
target = o,
return_table = TRUE
)result
result$Accuracy$`Frequency Table`
``````{r demo-longer}
result = confusion_matrix(
prediction = p,
target = o,
longer = TRUE
)result
```### Installation
To install from GitHub the devtools package is required.
```{r eval=FALSE}
devtools::install_github('m-clark/confusionMatrix')
```