| Title: | Model-Based Clustering of Network Data |
|---|---|
| Description: | Clustering unilayer and multilayer network data by means of finite mixtures is the main utility of netClust. |
| Authors: | Shuchismita Sarkar [aut, cre], Volodymyr Melnykov [aut] |
| Maintainer: | Shuchismita Sarkar <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.0.2 |
| Built: | 2026-05-28 15:05:19 UTC |
| Source: | https://github.com/cran/netClust |
Clustering unilayer and multilayer network data by means of finite mixtures is the main utility of netClust.
The DESCRIPTION file:
| Package: | netClust |
| Type: | Package |
| Title: | Model-Based Clustering of Network Data |
| Version: | 1.0.2 |
| Authors@R: | c(person(given = "Shuchismita", family = "Sarkar", role = c("aut", "cre"), email = "[email protected]"), person(given = "Volodymyr", family = "Melnykov", role = "aut")) |
| Maintainer: | Shuchismita Sarkar <[email protected]> |
| Description: | Clustering unilayer and multilayer network data by means of finite mixtures is the main utility of netClust. |
| License: | GPL (>= 2) |
| Depends: | R (>= 2.10) |
| Imports: | Rcpp (>= 1.0.2) |
| LinkingTo: | Rcpp, RcppArmadillo |
| RoxygenNote: | 7.3.2 |
| Encoding: | UTF-8 |
| NeedsCompilation: | yes |
| Packaged: | 2026-01-23 15:15:46 UTC; shuch |
| Author: | Shuchismita Sarkar [aut, cre], Volodymyr Melnykov [aut] |
| Repository: | https://cran.r-universe.dev |
| Date/Publication: | 2026-01-23 19:50:07 UTC |
| RemoteUrl: | https://github.com/cran/netClust |
| RemoteRef: | HEAD |
| RemoteSha: | 5523b77795c994198c14ee7204984263ccb04886 |
Index of help topics:
netClust-package Model-Based Clustering of Network Data
netData Dataset: netData
netDataID Dataset: netDataID
netEM_multilayer Returns the EM object for multilayer network
netEM_unilayer Returns the EM object for unilayer network
rcpparma_hello_world Set of functions in example RcppArmadillo
package
Provides model-based clustering for weighted networks. Core functions: netEM_unilayer() and netEM_multilayer().
Shuchismita Sarkar [aut, cre], Volodymyr Melnykov [aut]
Maintainer: Shuchismita Sarkar <[email protected]>
Melnykov, V., Sarkar, S. and Melnykov, Y., 2021. On finite mixture modeling and model-based clustering of directed weighted multilayer networks. Pattern Recognition, 112, p.107641.
data(netData) ## Read network data data(netDataID) ## Read original ID for network data n <- dim(netData)[1] ## number of nodes of the network p <- dim(netData)[4] ## number of layers of the network K <- 2 ## number of clusters y <- netData eps=0.0001 RndStrtUni= 5 RndStrtMult= 10 SmEMUni= 3 SmEMMult= 5 ItrSmEM=5 burn = 10*n ItrMCMC= 100*n sSigma = 1 sPsi = 1 a=0 ######################################################### ### Run unilayer network EM seperately for each layer ### ######################################################### for (MatC in 1:p){ x <- array(0, dim = c(n,n,2)) for (i in 1:n){ for (j in 1:n){ x[i,j,] <- y[i,j,,MatC] } } E <- netEM_unilayer(x, K, eps, RndStrtUni, SmEMUni, ItrSmEM, burn, ItrMCMC, sSigma,a) cat("Unilayer network", "Original ID", netDataID, "\n") cat("Unilayer network", "Feature", MatC, "Assigned ID", E$id, "\n") } ################################## ### Run multilayer network EM ### ################################## E <- netEM_multilayer(y,K,p, eps, RndStrtMult, SmEMMult, ItrSmEM, burn, ItrMCMC, sSigma, sPsi, n, a) cat("Multilayer network", "Original ID", netDataID, "\n") cat("Multilayer network", "Assigned ID", E$id, "\n")data(netData) ## Read network data data(netDataID) ## Read original ID for network data n <- dim(netData)[1] ## number of nodes of the network p <- dim(netData)[4] ## number of layers of the network K <- 2 ## number of clusters y <- netData eps=0.0001 RndStrtUni= 5 RndStrtMult= 10 SmEMUni= 3 SmEMMult= 5 ItrSmEM=5 burn = 10*n ItrMCMC= 100*n sSigma = 1 sPsi = 1 a=0 ######################################################### ### Run unilayer network EM seperately for each layer ### ######################################################### for (MatC in 1:p){ x <- array(0, dim = c(n,n,2)) for (i in 1:n){ for (j in 1:n){ x[i,j,] <- y[i,j,,MatC] } } E <- netEM_unilayer(x, K, eps, RndStrtUni, SmEMUni, ItrSmEM, burn, ItrMCMC, sSigma,a) cat("Unilayer network", "Original ID", netDataID, "\n") cat("Unilayer network", "Feature", MatC, "Assigned ID", E$id, "\n") } ################################## ### Run multilayer network EM ### ################################## E <- netEM_multilayer(y,K,p, eps, RndStrtMult, SmEMMult, ItrSmEM, burn, ItrMCMC, sSigma, sPsi, n, a) cat("Multilayer network", "Original ID", netDataID, "\n") cat("Multilayer network", "Assigned ID", E$id, "\n")
Network data with 20 nodes and 2 layers
data("netData")data("netData")
The format is: num [1:20, 1:20, 1:2, 1:2] 0 0 0 0 0 0 0 0 0 0 ...
Dataset demonstrating multilayer network
Sarkar, S. (2020)
Sarkar, S. (2019) On the use of transformations for modeling multidimensional heterogeneous data, The University of Alabama Libraries Digital Collections
data(netData) ## maybe str(netData) ; plot(netData) ...data(netData) ## maybe str(netData) ; plot(netData) ...
ID for netData dataset
data("netDataID")data("netDataID")
A data frame with 30 observations on the following 1 variable.
netDataIDa numeric vector
ID for the dataset demonstrating multilayer network
Sarkar, S. (2020)
Sarkar, S. (2019) On the use of transformations for modeling multidimensional heterogeneous data, The University of Alabama Libraries Digital Collections
data(netDataID) ## maybe str(netDataID) ; plot(netDataID) ...data(netDataID) ## maybe str(netDataID) ; plot(netDataID) ...
Returns the EM object for multilayer network
netEM_multilayer( y, K, p, eps, num_rand_start, num_run_smallEM, max_itr_smallEM, burn, MCMC_itr, sigma_mult, psi_mult, n, alpha )netEM_multilayer( y, K, p, eps, num_rand_start, num_run_smallEM, max_itr_smallEM, burn, MCMC_itr, sigma_mult, psi_mult, n, alpha )
y |
multiple network |
K |
number of clusters |
p |
number of layers |
eps |
epsilon for convergence |
num_rand_start |
number of random starts |
num_run_smallEM |
number of runs for small EM |
max_itr_smallEM |
maximum number of runs for small EM |
burn |
number of runs for burn for Metropolis Hastings |
MCMC_itr |
number of runs for Metropolis Hastings iterations |
sigma_mult |
scaling multiplier for Sigma matrix |
psi_mult |
scaling multiplier for Psi matrix |
n |
number of nodes of the network |
alpha |
seed provided by the user |
EM object
Returns the EM object for unilayer network
netEM_unilayer( x, K, eps, num_rand_start, num_run_smallEM, max_itr_smallEM, burn, MCMC_itr, sigma_mult, alpha )netEM_unilayer( x, K, eps, num_rand_start, num_run_smallEM, max_itr_smallEM, burn, MCMC_itr, sigma_mult, alpha )
x |
multiple network |
K |
number of clusters |
eps |
epsilon for convergence |
num_rand_start |
number of random starts |
num_run_smallEM |
number of runs for small EM |
max_itr_smallEM |
maximum number of runs for small EM |
burn |
number of runs for burn for Metropolis Hastings |
MCMC_itr |
number of runs for Metropolis Hastings iterations |
sigma_mult |
scaling multiplier for Sigma matrix |
alpha |
seed provided by the user |
EM object
These four functions are created when
RcppArmadillo.package.skeleton() is invoked to create a
skeleton packages.
rcpparma_hello_world() rcpparma_outerproduct(x) rcpparma_innerproduct(x) rcpparma_bothproducts(x)rcpparma_hello_world() rcpparma_outerproduct(x) rcpparma_innerproduct(x) rcpparma_bothproducts(x)
x |
a numeric vector |
These are example functions which should be largely self-explanatory. Their main benefit is to demonstrate how to write a function using the Armadillo C++ classes, and to have to such a function accessible from R.
rcpparma_hello_world() does not return a value, but displays a
message to the console.
rcpparma_outerproduct() returns a numeric matrix computed as the
outer (vector) product of x.
rcpparma_innerproduct() returns a double computer as the inner
(vector) product of x.
rcpparma_bothproducts() returns a list with both the outer and
inner products.
Dirk Eddelbuettel
See the documentation for Armadillo, and RcppArmadillo, for more details.
x <- sqrt(1:4) rcpparma_innerproduct(x) rcpparma_outerproduct(x)x <- sqrt(1:4) rcpparma_innerproduct(x) rcpparma_outerproduct(x)