modelPlot: LASSO Coefficient Plot

View source: R/modelPlot.R

modelPlotR Documentation

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)

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.

Value

ggplot object. Layers can be added like any ggplot object


politeness documentation built on April 4, 2025, 2:44 a.m.