ggplot.bolasso: plot a 'bolasso'

Description Usage Arguments Value Examples

View source: R/constructor.R

Description

The ggplot of a bolasso is a facet. In each plot of the facet, there is an histogram of coefficients that the feature obtains in each of the bootsrap samples. A red line shows the 0 coefficient value. If there are points at both sides of the red line, it means that the feature has both positive and negative signs, which doesn't make sense.

Usage

1
ggplot.bolasso(model, threshold_selection = NULL)

Arguments

model

bolasso object to plot

threshold_selection

If it is NULL, only variables with selection_rate above the one in the model are plotted. We can set this value to lower or higher to plot more or less variables.

Value

A ggplot object, faceted and with the distribution of each variable in it.

Examples

1
2
3
4
5
6
7
8
9
predictors <- mtcars[,c("mpg", "disp", "hp", "drat", "wt")]
outcome <- mtcars[, "vs"]


mod <- bolasso(predictors, outcome, n_bootstraps = 50)

ggplot(mod)
ggplot(mod, threshold_selection = 0.8)
ggplot(mod, threshold_selection = 0.2)

david26694/bolasso documentation built on Nov. 4, 2019, 9:43 a.m.