Returns the node coordinates computed by hypernets' existing hypergraph
spectral or symmetric-NMF engine without exposing the incidental k-means
assignments produced by hg_cluster().
Arguments
- hg
Any hypernets
net_hg.- dimensions
Number of embedding coordinates, between 2 and
n_nodes - 1.- type
Laplacian type:
"zhou"or"random_walk".- method
"spectral"(default) or Hayashi et al.'s"symnmf". SymNMF requires a dense incidence matrix.- seed
Optional initialization seed.
- nstart
Number of k-means starts for the shared engine; for spectral embeddings this affects only the discarded cluster assignment, not the returned coordinates. For SymNMF it is the number of factor restarts.
- max_iter, tol
SymNMF iteration controls.
References
Zhou, D., Huang, J., & Schölkopf, B. (2006). Learning with hypergraphs: clustering, classification, and embedding. Advances in Neural Information Processing Systems 19.
Hayashi, K., Aksoy, S. G., Park, C. H., & Park, H. (2020). Hypergraph random walks, Laplacians, and clustering. Proceedings of the 29th ACM International Conference on Information and Knowledge Management, 495-504. doi:10.1145/3340531.3412034
Examples
h <- group_hypergraph(
data.frame(node = c("a", "b", "c", "b", "c", "d"),
edge = rep(c("e1", "e2"), each = 3)),
"node", "edge"
)
hg_embed(h, dimensions = 2)
#> node pi dim1 dim2
#> 1 a 0.1666667 -0.5 -8.660254e-01
#> 2 b 0.3333333 -1.0 8.570850e-16
#> 3 c 0.3333333 -1.0 5.851370e-16
#> 4 d 0.1666667 -0.5 8.660254e-01