plotNet: plotNet

Description Usage Arguments Value Examples

View source: R/plotNet.R

Description

@description Create a Network style plot displaying Variable and Variable Interaction.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
plotNet(
  dinteraction,
  model,
  thresholdValue = 0,
  label,
  fitlimsInt = NULL,
  fitlimsImp = NULL,
  intPal = rev(sequential_hcl(palette = "Blues 3", n = 11)),
  impPal = rev(sequential_hcl(palette = "Reds 3", n = 11)),
  labelNudge = 0.05,
  layout = "circle",
  cluster = F,
  clusterType = cluster_optimal,
  clusterLayout = layout_with_fr,
  ...
)

Arguments

thresholdValue

A value chosen by the user which will show all the edges with weights (i.e., the interacions) above that value. For example, if thresholdValue = 0.2, then only the the interacions greater than 0.2 will be displayed.

label

If label = TRUE the numerical value for the interaction strength will be displayed.

intPal

A colorspace colour palette to display the interaction values.

impPal

A colorspace colour palette to display the importance values.

labelNudge

A value, set by the user, to determine the y_postioning of the variables names. A higher value will postion the label farther above the nodes.

layout

Determines the shape, or layout, of the plotted graph.

cluster

If cluster = TRUE, then the data is clustered in groups.

clusterType

= Network-based clustering. Any of the appropriate cluster types from the igraph package are allowed.

clusterLayout

= Determines the shape, or layout, of the clustered plotted graph.

...

Not currently implemented.

mat

A matrix of values to be plotted. Either added by the user or created using the prepFunc() function.

minInt

Minimum interaction strength to be displayed on the legend.

maxInt

Maximum interaction strength to be displayed on the legend.

minImp

Minimum importance value to be displayed on the legend.

maxImp

Maximum importance value to be displayed on the legend.

Value

A newtwork style plot displaying interaction strength between variables on the edges and variable importance on the nodes.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Load in the data:
aq <- data.frame(airquality)
aq <- na.omit(aq)

# Run an mlr ranger model:
library(mlr3)
library(mlr3learners)
library(ranger)
aq_Task <- TaskRegr$new(id = "airQ", backend = aq, target = "Ozone")
aq_lrn <- lrn("regr.ranger", importance = "permutation")
aq_Mod <- aq_lrn$train(aq_Task)

# Create matrix
myMat <- vividMatrix(task = aq_Task,  model = aq_Mod)

# Create plot:
plot(myMat, type = "network")

AlanInglis/vividOld documentation built on March 4, 2021, 12:44 a.m.