An open API service indexing awesome lists of open source software.

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. 🎯

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
)
```

[![R build status](https://github.com/m-clark/confusionMatrix/workflows/R-CMD-check/badge.svg)](https://github.com/m-clark/confusionMatrix/actions)
[![Codecov test coverage](https://codecov.io/gh/m-clark/confusionMatrix/branch/master/graph/badge.svg)](https://codecov.io/gh/m-clark/confusionMatrix?branch=master)
[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-experimental-blue.svg)](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')
```