Create a ggplot for a model objectSource:
This method provides a good visualization method for model results. Currently, only methods for glmnet models are implemented.
A model fit object.
autoplot.glmnet(), options to pass to
ggrepel::geom_label_repel(). Otherwise, this argument is ignored.
A single, non-negative number for the smallest penalty value that should be shown in the plot. If left
NULL, the whole data range is used.
A single, non-negative number that will show a vertical line marker. If left
NULL, no line is shown. When this argument is used, the ggrepl package is required.
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
top_nterms are selected within class or response, respectively.
A ggplot object with penalty on the x-axis and coefficients on the y-axis. For multinomial or multivariate models, the plot is faceted.
The glmnet package will need to be attached or loaded for
autoplot() method to work correctly.