| nmfkc.net.DOT | R Documentation |
Creates a Graphviz DOT script that visualizes the two-layer structure
of a symmetric NMF model (Y \approx X C X^\top).
The resulting diagram displays:
outer nodes: the original network nodes (rows/columns of Y),
inner nodes: the latent basis/group nodes (columns of X),
directed edges from basis to node: membership weights from X,
undirected edges between basis nodes: inter-group interactions from C matrix (for tri-symmetric models only).
nmfkc.net.DOT(
result,
threshold = 0.01,
sig.level = 0.1,
weight_scale = 5,
weight_scale_xy = 1,
weight_scale_xx = weight_scale,
rankdir = "TB",
fill = TRUE,
hide.isolated = TRUE,
Y.label = NULL,
X.label = NULL,
Y.title = "Nodes (Y)",
X.title = "Basis (X)",
show.theta = NULL,
signed = inherits(result, "nmfkc.net.signed"),
cluster.box = c("none", "normal", "faint", "invisible"),
layout = c("neato", "fdp", "twopi", "circo", "dot"),
X.color = NULL,
Y.cluster = c("soft", "hard")
)
result |
A list returned by |
threshold |
Minimum coefficient value to display an edge. |
sig.level |
Significance level for filtering C edges (if inference
results are present). Set to |
weight_scale |
Base scaling factor for edge widths. |
weight_scale_xy |
Scaling factor for X edges (basis -> node). |
weight_scale_xx |
Scaling factor for C edges (basis <-> basis). |
rankdir |
Graphviz rank direction ( |
fill |
Logical; whether nodes are filled with color. |
hide.isolated |
Logical; if TRUE, omit outer nodes with no X edge above threshold. |
Y.label |
Character vector of labels for outer nodes. |
X.label |
Character vector of labels for basis nodes. |
Y.title |
Cluster title for outer nodes. |
X.title |
Cluster title for basis nodes. |
show.theta |
Logical or NULL. Whether to draw C edges between basis nodes. NULL = auto-detect (TRUE for tri, FALSE for bi). |
signed |
Logical. If |
cluster.box |
Style of cluster box: |
layout |
Graphviz layout engine, in recommended order:
|
X.color |
Color palette for basis nodes (length Q). |
Y.cluster |
Coloring mode for outer nodes: |
A character string of class c("nmfkc.net.DOT", "nmfkc.DOT")
representing a valid Graphviz DOT script.
Use plot() to render (requires DiagrammeR).
This function is experimental. The interface may change in future versions; details are to be described in an upcoming paper.
nmfkc.net.inference, nmfkc.DOT,
plot.nmfkc.DOT
library(nmfkc)
Y <- matrix(c(0,1,1,0,0,0,
1,0,1,0,0,0,
1,1,0,1,0,0,
0,0,1,0,1,1,
0,0,0,1,0,1,
0,0,0,1,1,0), 6, 6)
res <- nmfkc.net(Y, rank = 2, type = "tri", nstart = 20)
dot <- nmfkc.net.DOT(res)
plot(dot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.