plot.interpret: Plot regularized model coefficients

View source: R/interpret.R

plot.interpretR Documentation

Plot regularized model coefficients

Description

Plot regularized model coefficients

Usage

## S3 method for class 'interpret'
plot(
  x,
  include_intercept = FALSE,
  max_char = 40,
  title,
  caption,
  font_size = 11,
  point_size = 3,
  print = TRUE,
  ...
)

Arguments

x

A interpret object or a data frame with columns "variable" and "coefficient"

include_intercept

If FALSE (default) the intercept estimate will not be plotted

max_char

Maximum length of variable names to leave untruncated. Default = 40; use Inf to prevent truncation. Variable names longer than this will be truncated to leave the beginning and end of each variable name, bridged by " ... ".

title

Plot title. NULL for no title; character for custom title. If left blank contains the model class and outcome variable

caption

Plot caption, appears in lower-right. NULL for no caption; character for custom caption. If left blank the caption will contain info including the hyperparameter values of the model used by interpret to determine coefficient estimates.

font_size

Relative size of all fonts in plot, default = 11

point_size

Size of dots, default = 3

print

Print the plot? Default = TRUE

...

Unused

Value

A ggplot object, invisibly.

See Also

interpret

Examples

machine_learn(mtcars, outcome = mpg, models = "glm", tune = FALSE) %>%
  interpret() %>%
  plot(font_size = 14)

healthcareai documentation built on Sept. 5, 2022, 5:12 p.m.