View source: R/dbn_visualization.R
plot_dynamic_network | R Documentation |
To plot the DBN, this method first computes a hierarchical structure for a time slice and replicates it for each slice. Then, it calculates the relative position of each node with respect to his equivalent in the first slice. The result is a net where each time slice is ordered and separated from one another, where the leftmost slice is the oldest and the rightmost represents the present time. This function is also called by the generic plot function of "dbn" and "dbn.fit" S3 objects.
plot_dynamic_network(
structure,
offset = 200,
subset_nodes = NULL,
reverse = FALSE
)
structure |
the structure or fit of the network. |
offset |
the blank space between time slices |
subset_nodes |
a vector containing the names of the subset of nodes to plot |
reverse |
reverse to the classic naming convention of the nodes. The oldest time-slice will now be t_0 and the most recent one t_n. Only for visualization purposes, the network is unmodified underneath. If using subset_nodes, remember that t_0 is now the oldest time-slice. |
the visualization of the DBN
size = 3
dt_train <- dbnR::motor[200:2500]
net <- learn_dbn_struc(dt_train, size)
plot_dynamic_network(net)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.