sbfc_graph: SBFC graph

Description Usage Arguments Examples

View source: R/sbfc.R

Description

Plots a sampled MCMC graph or an average of sampled graphs using Graphviz.
In average graphs, nodes are color-coded according to importance - the proportion of samples where the node appeared in Group 1 (dark-shaded nodes appear more often). In average graphs, thickness of edges also corresponds to importance: the proportion of samples where the edge appeared.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
sbfc_graph(
  sbfc_result,
  iter = 10000,
  average = T,
  edge_cutoff = 0.1,
  single_noise_nodes = F,
  labels = paste0("X", 1:ncol(sbfc_result$parents)),
  save_graphviz_code = F,
  colorscheme = "blues",
  ncolors = 7,
  width = NULL,
  height = NULL
)

Arguments

sbfc_result

An object of class sbfc.

iter

MCMC iteration of the sampled graph to plot, if average=F (default=10000).

average

Plot an average of sampled MCMC graphs (default=TRUE).

edge_cutoff

The average graph includes edges that appear in at least this fraction of the sampled graphs, if average=T (default=0.1).

single_noise_nodes

Plot single-node trees that appear in the noise group (Group 0) in at least 80 percent of the samples, which can be numerous for high-dimensional data sets (default=FALSE).

labels

A vector of node labels (default=c("X1","X2",...)).

save_graphviz_code

Save the Graphviz source code in a .gv file (default=FALSE).

colorscheme

Graphviz color scheme for the nodes (default="blues").

ncolors

number of colors in the palette (default=7).

width

An optional parameter for specifying the width of the resulting graphic in pixels.

height

An optional parameter for specifying the height of the resulting graphic in pixels.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(madelon)
madelon_result = sbfc(madelon)
sbfc_graph(madelon_result) 
sbfc_graph(madelon_result, average=FALSE, iter=5000) # graph for 5000th iteration
sbfc_graph(madelon_result, single_noise_nodes=TRUE) # wide graph with 480 single nodes

data(heart)
heart_result = sbfc(heart)
heart_labels = c("Age", "Sex", "Chest Pain", "Rest Blood Pressure", "Cholesterol", 
"Blood Sugar", "Rest ECG", "Max Heart Rate", "Angina", "ST Depression", "ST Slope",
"Fluoroscopy Colored Vessels", "Thalassemia")
sbfc_graph(heart_result, labels=heart_labels, width=700)

sbfc documentation built on Jan. 16, 2022, 1:06 a.m.