add_sparklines: Add sparklines

Description Usage Arguments Value References

View source: R/add_sparklines.R

Description

Create an HTML widget to display variable importance scores with a sparkline representation of each features effect (i.e., its partial dependence function).

Usage

1
2
3
4
add_sparklines(object, fit, digits = 3, free_y = FALSE, verbose = FALSE, ...)

## S3 method for class 'vi'
add_sparklines(object, fit, digits = 3, free_y = FALSE, verbose = FALSE, ...)

Arguments

object

An object that inherits from class "vi".

fit

The original fitted model. Only needed if 'vi()' was not called with 'method = "firm"'.

digits

Integer specifying the minimal number of significant digits to use for displaying importance scores and, if available, their standard deviations.

free_y

Logical indicating whether or not the the y-axis limits should be allowed to vary for each sparkline. Default is FALSE.

verbose

Logical indicating whether or not to print progress. Default is FALSE.

...

Additional optional arguments to be passed on to partial.

Value

An object of class c("datatables", "htmlwidget"); essentially, a data frame with three columns: Variable, Importance, and Effect (a sparkline representation of the partial dependence function). For "lm"/"glm"-like objects, an additional column, called Sign, is also included which includes the sign (i.e., POS/NEG) of the original coefficient.

References

Greenwell, B. M., Boehmke, B. C., and McCarthy, A. J. A Simple and Effective Model-Based Variable Importance Measure. arXiv preprint arXiv:1805.04755 (2018).


vip documentation built on Dec. 17, 2020, 5:08 p.m.