-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
156 lines (114 loc) · 2.95 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
---
output: github_document
---
<head>
<link rel="stylesheet" type="text/css" href="https://d335w9rbwpvuxm.cloudfront.net/semantic.min.css"/>'
</head>
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
warning = F, error = F, message = F,
collapse = T,
comment = "#>",
fig.path = "man/figures/README-",
fig.pos = "center"
#out.width = "100%"
)
```
# mlgraph <img src="data/mlgraph.png" width="160px" align="right" />
```{r, echo = FALSE, results='asis', eval = T, eval = T}
library(badger)
git_repo <- "systats/mlgraph"
cat(
#badge_travis(git_repo),
#"[![Codecov test coverage](https://codecov.io/gh/favstats/peRspective/branch/master/graph/badge.svg)](https://codecov.io/gh/favstats/peRspective?branch=master)",
badge_code_size(git_repo),
badge_last_commit(git_repo),
badge_lifecycle("experimental", "blue")
)
```
`mlgraph` provides performance visualizations for standardized ml models with linear, binary or multi tasks. It is implemented as an extension of [deeplyr](). At the moment several graphics packages are implemented including
* `gg_` ggplot2
* `hc_` highcharter
* `ax_` apexcharter
Computations are based on
* [Metrics](https://github.com/mfrasco/Metrics)
* [yardstick](https://github.com/tidymodels/yardstick)
Several task specific plots are available:
* Linear
+ ...
* Binary
+ Confusion Matrix
+ ROC
+ Density
* Multi
+ Confusion Matrix
+ ROC
+ Density
# Installation
Get the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("systats/mlgraph")
```
```{r, echo = F}
pacman::p_load(tidyverse, mlgraph)
ggplot2::theme_set(ggplot2::theme_bw())
```
```{r}
preds <- readRDS("data/preds.rds") %>%
glimpse
```
```{r}
df <- mlgraph::eval_classifier(preds, target, pred, prob1) %>% glimpse
```
### ggplot2
```{r, eval = F}
gg_plot2 <- gridExtra::grid.arrange(
gg_plot_confusion(df$confusion),
gg_plot_roc(df$roc),
gg_plot_density(df$dens), nrow = 1
)
ggsave(gg_plot2, filename = "man/figures/gg_plot2.png", width = 18, height = 6)
```
![](man/figures/gg_charts.png)
### highcharter
```{r, eval = F}
pacman::p_load(shiny, shiny.semantic)
shiny.semantic::semanticPage(
div(class= "ui three column grid",
div(class = "column",
hc_plot_confusion(df$confusion)
),
div(class = "column",
hc_plot_roc(df$roc)
),
div(class = "column",
hc_plot_density(df$dens)
)
)
)
```
![](man/figures/hc_charts.png)
### apexcharter
```{r, eval = F}
pacman::p_load(shiny, shiny.semantic)
shiny.semantic::semanticPage(
div(class= "ui three column grid",
div(class = "column",
ax_plot_confusion(df$confusion)
),
div(class = "column",
ax_plot_roc(df$roc)
),
div(class = "column",
ax_plot_density(df$dens)
)
)
)
#htmltools::html_print(out)
```
![](man/figures/ax_charts.png)
```{r}
sessionInfo()
```