Skip to content

Commit

Permalink
Merge pull request #30 from ModelOriented/before_cran
Browse files Browse the repository at this point in the history
v0.1.9
  • Loading branch information
hbaniecki authored Nov 3, 2019
2 parents bbb4def + b7356a9 commit 7d401f0
Show file tree
Hide file tree
Showing 33 changed files with 161 additions and 146 deletions.
3 changes: 2 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ modelStudio_my_test.R
^CRAN-RELEASE$
^cran-comments\.md$
^pkgdown.*$
CONTRIBUTING.md
^LICENSE$
^CONTRIBUTING.md
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ language: R
sudo: false
cache: packages

env:
global:
- R_CHECK_ARGS="--timings --run-donttest"

r:
- release
- devel
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Contribute to modelStudio
# Contribute to modelStudio

#### **Did you find a bug?**

Expand Down
14 changes: 7 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: modelStudio
Title: Interactive Studio with Explanations for ML Predictive Models
Version: 0.1.8
Version: 0.1.9
Authors@R:
c(person("Hubert", "Baniecki", role = c("aut", "cre"),
email = "[email protected]",
Expand All @@ -10,22 +10,22 @@ Authors@R:
Description: Automate explanation of machine learning predictive models.
This package generates advanced interactive and animated model explanations in the form
of a serverless HTML site. It combines 'R' with 'D3.js' to produce plots and descriptions
for local and global explanations. The whole is greater than the sum of its parts,
so it also supports EDA (Exploratory Data Analysis) on top of that. 'modelStudio' is
a fast and condensed way to get all the answers without much effort.
for various local and global explanations. Tools for model exploration unite with
tools for EDA (Exploratory Data Analysis) to give a broad overview of the model behaviour.
'modelStudio' is a fast and condensed way to get all the answers without much effort.
Break down your model and look into its ingredients with only a few lines of code.
Depends: R (>= 3.5.0)
License: file LICENSE
License: GPL-2
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.1
Imports:
iBreakDown (>= 0.9.9),
ingredients (>= 0.3.9),
ingredients (>= 0.4.0),
r2d3,
jsonlite
Suggests:
DALEX,
DALEX (>= 0.4.9),
parallelMap,
randomForest,
knitr,
Expand Down
7 changes: 5 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# modelStudio 0.1.9
* This version requires `DALEX 0.4.9` and `ingredients 0.4.0`

# modelStudio 0.1.8
* change "Shapley Values" to "SHAP Values"
* Lower `B` default value from 25 to 15
* change `Shapley Values` to `SHAP Values`
* Lower `B` default value from 25 to 15, `N` default value from 500 to 400

# modelStudio 0.1.7
* fix tests for CRAN
Expand Down
38 changes: 19 additions & 19 deletions R/modelStudio.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @title Generates interactive studio to explain predictive model
#' @title Generate Interactive Studio with Explanations for the Model
#'
#' @description
#' This tool uses your model, data and new observations, to provide local
Expand All @@ -7,29 +7,29 @@
#'
#' Find more details about plots in \href{https://pbiecek.github.io/PM_VEE/}{Predictive Models: Explore, Explain, and Debug}
#'
#' @param object an explainer created with function \code{DALEX::explain()} or a model to be explained.
#' @param new_observation a new observation with columns that correspond to variables used in the model.
#' @param facet_dim dimensions of the grid. Default is \code{c(2,2)}.
#' @param time in ms. Set animation length. Default is \code{500}.
#' @param max_features maximum number of features to be included in Break Down and SHAP Values plots. Default is \code{10}.
#' @param N number of observations used for calculation of partial dependency profiles. Default is \code{500}.
#' @param B number of random paths used for calculation of SHAP values. Default is \code{15}.
#' @param show_info verbose progress bar on console? Default is \code{TRUE}.
#' @param parallel speed up computation using \code{parallelMap::parallelMap()}.
#' @param object An \code{explainer} created with function \code{DALEX::explain()} or a model to be explained.
#' @param new_observation A new observation with columns that correspond to variables used in the model.
#' @param facet_dim Dimensions of the grid. Default is \code{c(2,2)}.
#' @param time Time in ms. Set animation length. Default is \code{500}.
#' @param max_features Maximum number of features to be included in Break Down and SHAP Values plots. Default is \code{10}.
#' @param N Number of observations used for calculation of partial dependency profiles. Default is \code{400}.
#' @param B Number of random paths used for calculation of SHAP values. Default is \code{15}.
#' @param show_info Verbose progress bar on the console. Default is \code{TRUE}.
#' @param parallel Speed up the computation using \code{parallelMap::parallelMap()}.
#' See \href{https://modeloriented.github.io/modelStudio/articles/vignette_modelStudio.html#parallel-computation}{\bold{vignette}}.
#' @param viewer Default is \code{external} to display in an external RStudio window.
#' Use \code{browser} to display in an external browser or
#' \code{internal} to use the RStudio internal viewer pane for output.
#' @param options customize \code{modelStudio}. See \code{\link{modelStudioOptions}} and
#' @param options Customize \code{modelStudio}. See \code{\link{modelStudioOptions}} and
#' \href{https://modeloriented.github.io/modelStudio/articles/vignette_modelStudio.html#plot-options}{\bold{vignette}}.
#' @param ... other parameters.
#' @param data validation dataset, will be extracted from \code{object} if it is an explainer.
#' @param ... Other parameters.
#' @param data Validation dataset, will be extracted from \code{object} if it is an explainer.
#' NOTE: It is best when target variable is not present in the \code{data}.
#' @param y true labels for \code{data}, will be extracted from \code{object} if it is an explainer.
#' @param predict_function predict function, will be extracted from \code{object} if it is an explainer.
#' @param label a name of the model, will be extracted from \code{object} if it is an explainer.
#' @param y True labels for \code{data}, will be extracted from \code{object} if it is an \code{explainer}.
#' @param predict_function Predict function, will be extracted from \code{object} if it is an \code{explainer}.
#' @param label A name of the model, will be extracted from \code{object} if it is an \code{explainer}.
#'
#' @return an object of the \code{r2d3} class
#' @return An object of the \code{r2d3} class.
#'
#' @importFrom utils head tail setTxtProgressBar txtProgressBar installed.packages
#' @importFrom stats aggregate predict
Expand Down Expand Up @@ -100,7 +100,7 @@ modelStudio.explainer <- function(object,
facet_dim = c(2,2),
time = 500,
max_features = 10,
N = 500,
N = 400,
B = 15,
show_info = TRUE,
parallel = FALSE,
Expand Down Expand Up @@ -139,7 +139,7 @@ modelStudio.default <- function(object,
facet_dim = c(2,2),
time = 500,
max_features = 10,
N = 500,
N = 400,
B = 15,
show_info = TRUE,
parallel = FALSE,
Expand Down
24 changes: 12 additions & 12 deletions R/modelStudioOptions.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#' @title Get modified options for modelStudio
#' @title Modifiy options and pass them to modelStudio
#'
#' @description This function returns default options for \code{\link{modelStudio}}.
#' It is possible to modify values of this list and pass it to \code{options}
#' It is possible to modify values of this list and pass it to the \code{options}
#' parameter in the main function. \strong{WARNING: Editing default options may cause
#' unintended behavior.}
#'
#' @param ... options to change, \code{option_name = value}.
#' @param ... Options to change, \code{option_name = value}.
#'
#' @return \code{list} of options for modelStudio
#' @return \code{list} of options for \code{modelStudio}.
#'
#' \subsection{Main options:}{
#' \describe{
#' \item{scale_plot}{\code{TRUE} Makes every plot the same height, ignores \code{bar_width}.}
#' \item{show_subtitle}{\code{TRUE} Should subtitle be displayed?}
#' \item{show_subtitle}{\code{TRUE} Should the subtitle be displayed?}
#' \item{subtitle}{\code{label} parameter from \code{explainer}.}
#' \item{margin_*}{plot margins. Change \code{margin_left} for longer/shorter axis labels.}
#' \item{margin_*}{Plot margins. Change \code{margin_left} for longer/shorter axis labels.}
#' \item{w}{\code{420} in px. Inner plot width.}
#' \item{h}{\code{280} in px. Inner plot height.}
#' \item{bar_width}{\code{16} in px. Default width of bars for all plots,
Expand All @@ -32,13 +32,13 @@
#' one of \code{[bd,sv,cp,fi,pd,ad,fd]}.\cr
#'
#' \describe{
#' \item{**_title}{plot specific title. Default varies.}
#' \item{**_subtitle}{plot specific subtitle. Default is \code{subtitle}.}
#' \item{**_bar_width}{plot specific width of bars. Default is \code{bar_width},
#' \item{**_title}{Plot specific title. Default varies.}
#' \item{**_subtitle}{Plot specific subtitle. Default is \code{subtitle}.}
#' \item{**_bar_width}{Plot specific width of bars. Default is \code{bar_width},
#' ignored when \code{scale_plot = TRUE}.}
#' \item{**_line_size}{\code{line_size} plot specific width of lines. Default is \code{line_size}.}
#' \item{**_point_size}{plot specific point radius. Default is \code{point_size}.}
#' \item{**_*_color}{plot specific \code{[bar,line,point]} color. Default is \code{[bar,line,point]_color}.}
#' \item{**_line_size}{\code{line_size} Plot specific width of lines. Default is \code{line_size}.}
#' \item{**_point_size}{Plot specific point radius. Default is \code{point_size}.}
#' \item{**_*_color}{Plot specific \code{[bar,line,point]} color. Default is \code{[bar,line,point]_color}.}
#' }
#' }
#'
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
[![Build Status](https://travis-ci.org/ModelOriented/modelStudio.svg?branch=master)](https://travis-ci.org/ModelOriented/modelStudio)
[![Coverage Status](https://codecov.io/gh/ModelOriented/modelStudio/branch/master/graph/badge.svg)](https://codecov.io/github/ModelOriented/modelStudio?branch=master)
[![DrWhy-eXtrAI](https://img.shields.io/badge/DrWhy-AutoMat-ae2c87)](http://drwhy.ai/#AutoMat)
[![JOSS-status](https://joss.theoj.org/papers/9eec8c9d1969fbd44b3ea438a74af911/status.svg)](https://joss.theoj.org/papers/9eec8c9d1969fbd44b3ea438a74af911)

## Overview

The `modelStudio` package automates explanation of machine learning predictive models. This package generates advanced interactive and animated model explanations in the form of a serverless HTML site.

It combines **R** with **D3.js** to produce plots and descriptions
for local and global explanations. The whole is greater than the sum of its parts,
so it also supports EDA (Exploratory Data Analysis) on top of that. `modelStudio` is
a fast and condensed way to get all the answers without much effort. Break down your model
and look into its ingredients with only a few lines of code.
for various local and global explanations. Tools for model exploration unite with
tools for EDA (Exploratory Data Analysis) to give a broad overview of the model behaviour.
`modelStudio` is a fast and condensed way to get all the answers without much effort. Break down your model and look into its ingredients with only a few lines of code.

[See a demo](https://modeloriented.github.io/modelStudio/demo.html) &emsp; [Read the vignette: modelStudio - perks and features](https://modeloriented.github.io/modelStudio/articles/vignette_modelStudio.html)

Expand All @@ -36,8 +36,6 @@ devtools::install_github("ModelOriented/modelStudio")

This package bases on `DALEX` explainers created with `DALEX::explain()`.

**Demo works on the new version of DALEX** ``` devtools::install_github("ModelOriented/DALEX") ```

```r
library("modelStudio")

Expand Down Expand Up @@ -86,4 +84,4 @@ and [`r2d3::save_d3_png()`](https://rstudio.github.io/r2d3/articles/publishing.h

## Acknowledgments

Work on this package was financially supported by the 'NCN Opus grant 2016/21/B/ST6/02176'.
Work on this package was financially supported by the `NCN Opus grant 2016/21/B/ST6/02176`.
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions docs/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/articles/vignette_modelStudio.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed docs/images/gif1.gif
Binary file not shown.
Binary file removed docs/images/gif2.gif
Binary file not shown.
Binary file modified docs/images/gif3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/gif3dep.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/gif4.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/gif4dep.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7d401f0

Please sign in to comment.