plot_param: Plot Probabilities A Model Keeps Parameters

View source: R/plot_param.R

plot_paramR Documentation

Plot Probabilities A Model Keeps Parameters

Description

Provides a plot to visualize the probability that each of several models includes specific parameters.

Usage

plot_param(data, grp.col, remove.int = FALSE)

Arguments

data

A data frame whose first column should be named "model" and contain model names, and whose remaining columns contain the probabilities that the models included that parameter.

grp.col

A vector of color names that will correspond to each model.

remove.int

Logical. When TRUE assumes that the second column is for the intercept and removes it. The default is FALSE.

Value

An object of class gg and ggplot.

Examples

dfp <- data.frame(model = c("glmnet", "bmlasso", "bmlasso_iar"),
                  x1 = c(0.01, 0.05, 0.10),
                  x2 = c(0.05, 0.10, 0.01),
                  x3 = c(0.95, 0.90, 0.85),
                  x4 = c(0.7, 0.6, 0.5),
                  x5 = c(0.1, 0.2, 0.3))
dfp$model <- factor(
  dfp$model,
  levels = c("glmnet", "bmlasso", "bmlasso_iar")
  )
plot_param(data = dfp, grp.col = c("#E69F00", "#56B4E9", "#009E73"))


jmleach-bst/ssnet documentation built on March 4, 2024, 5:04 p.m.