Learn R Programming

politeness (version 0.9.4)

modelPlot: LASSO Coefficient Plot

Description

Plots feature counts and coefficients from a trained LASSO model

This plots the coefficients from a trained LASSO model.

Usage

modelPlot(model1, counts, model2 = NULL, dat = FALSE)

Value

ggplot object. Layers can be added like any ggplot object

Arguments

model1

Trained glmnet model

counts

Feature counts - either from training data or test data (choose based on application of interest)

model2

Trained glmnet model (optional) If you want the Y axis to reflect a second set of coefficients, instead of feature counts.

dat

logical If TRUE, then function will return a list with the data.frame used for plotting, as well as the plot itself.