plot.citodnn: Plot the effects or the architecture of a DNN

View source: R/dnn.R

plot.citodnnR Documentation

Plot the effects or the architecture of a DNN

Description

plot_type = "ALE" (default) plots the accumulated local effects of the features (see ALE); plot_type = "arch" draws the network architecture as a graph, including embeddings and fixed effects, and needs the packages 'ggraph' and 'igraph'.

Usage

## S3 method for class 'citodnn'
plot(x, plot_type = c("ALE", "arch"), node_size = 1, scale_edges = FALSE, ...)

## S3 method for class 'citodnnBootstrap'
plot(
  x,
  plot_type = c("ALE", "arch"),
  node_size = 1,
  scale_edges = FALSE,
  which_model = 1,
  ...
)

Arguments

x

a model created by dnn

plot_type

plot ALE or architecture

node_size

size of node in plot

scale_edges

edge weight gets scaled according to other weights (layer specific)

...

no further functionality implemented yet

which_model

which model from the ensemble should be plotted

Value

For "ALE", the plots of ALE; for "arch", a 'ggraph' plot of the network.

Examples


if(torch::torch_is_installed()){
library(cito)

set.seed(222)
validation_set<- sample(c(1:nrow(datasets::iris)),25)

# Build and train  Network
nn.fit<- dnn(Sepal.Length~., data = datasets::iris[-validation_set,])

# accumulated local effects
plot(nn.fit)

# architecture
if(requireNamespace("ggraph", quietly = TRUE)) plot(nn.fit, plot_type = "arch")
}


cito documentation built on Nov. 23, 2026, 5:07 p.m.