'

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

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

Computations are based on

Several task specific plots are available:

Installation

Get the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("systats/mlgraph")
pacman::p_load(tidyverse, mlgraph)
ggplot2::theme_set(ggplot2::theme_bw())
preds <- readRDS("data/preds.rds") %>% 
  glimpse
df <- mlgraph::eval_classifier(preds, target, pred, prob1) %>% glimpse

ggplot2

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)

highcharter

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

apexcharter

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)

sessionInfo()


systats/mlgraph documentation built on Feb. 25, 2020, 10:37 a.m.