autoplot.model_fit {parsnip} | R Documentation |
Create a ggplot for a model object
Description
This method provides a good visualization method for model results. Currently, only methods for glmnet models are implemented.
Usage
## S3 method for class 'model_fit'
autoplot(object, ...)
## S3 method for class 'glmnet'
autoplot(object, ..., min_penalty = 0, best_penalty = NULL, top_n = 3L)
Arguments
object |
A model fit object. |
... |
For |
min_penalty |
A single, non-negative number for the smallest penalty
value that should be shown in the plot. If left |
best_penalty |
A single, non-negative number that will show a vertical
line marker. If left |
top_n |
A non-negative integer for how many model predictors to label.
The top predictors are ranked by their absolute coefficient value. For
multinomial or multivariate models, the |
Details
The glmnet package will need to be attached or loaded for
its autoplot()
method to work correctly.
Value
A ggplot object with penalty on the x-axis and coefficients on the y-axis. For multinomial or multivariate models, the plot is faceted.