Create an HTML widget to display variable importance scores with a sparkline representation of each features effect (i.e., its partial dependence function).
Usage
add_sparklines(object, fit, digits = 3, free_y = FALSE, verbose = FALSE, ...)
# S3 method for 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 withmethod = "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.