-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathREADME.Rmd
67 lines (44 loc) · 1.53 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
output:
github_document
encoding: 'UTF-8'
---
```{r, include = FALSE}
knitr::opts_chunk$set(
fig.path = "man/figures/",
comment = NA
)
```
<!-- badges: start -->
[![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)
<!-- badges: end -->
# confusionMatrix
<br>
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 <span class="emph" style = "">**tidy**</span> 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 <span class="pack">devtools</span> package is required.
```{r eval=FALSE}
devtools::install_github('m-clark/confusionMatrix')
```