barplot.BranchGLMVI: Bar Plot Method for BranchGLMVI Objects

View source: R/VariableImportance.R

barplot.BranchGLMVIR Documentation

Bar Plot Method for BranchGLMVI Objects

Description

Creates a bar plot with the L0-penalization based variable importance values.

Usage

## S3 method for class 'BranchGLMVI'
barplot(
  height,
  modified = FALSE,
  horiz = TRUE,
  decreasing = FALSE,
  which = "all",
  las = ifelse(horiz, 1, 2),
  main = NULL,
  lab = NULL,
  ...
)

Arguments

height

a BranchGLMVI object.

modified

a logical value indicating if the modified variable importance values should be plotted.

horiz

a logical value to indicate whether bars should be horizontal.

decreasing

a logical value to indicate whether variables should be sorted in decreasing order. Can use NA if no ordering is desired.

which

which variable importance values to plot, can use a numeric vector of indices, a character vector of names, or "all" for all variables.

las

the style of axis labels, see par for more details.

main

the overall title for the plot.

lab

the title for the axis corresponding to the variable importance values.

...

further arguments passed to barplot.default.

Value

This only produces a plot, nothing is returned.

Examples

Data <- iris
Fit <- BranchGLM(Sepal.Length ~ ., data = Data, family = "gaussian", link = "identity")

# Doing branch and bound selection 
VS <- VariableSelection(Fit, type = "branch and bound", metric = "BIC", 
showprogress = FALSE)

# Getting variable importance
VI <- VariableImportance(VS, showprogress = FALSE)
VI

# Plotting variable importance
oldmar <- par("mar")
par(mar = c(4, 6, 3, 1) + 0.1)
barplot(VI)
par(mar = oldmar)


BranchGLM documentation built on Sept. 28, 2024, 9:07 a.m.