Learn R Programming

jrSiCKLSNMF (version 1.2.3)

ClusterSickleJr: Cluster the \(\mathbf{H}\) matrix

Description

Perform k-means, spectral clustering, clustering based off of the index of the maximum latent factor, or Louvain community detection on the \(\mathbf{H}\) matrix. Defaults to k-means.

Usage

ClusterSickleJr(
  SickleJr,
  numclusts,
  method = "kmeans",
  neighbors = 20,
  louvainres = 0.3
)

Value

SickleJr- an object of class SickleJr with added clustering information

Arguments

SickleJr

An object of class SickleJr

numclusts

Number of clusters; can be NULL when method is "max" or "louvain"

method

String holding the clustering method: can choose "kmeans" for k-means clustering, "spectral" for spectral clustering, "louvain" for Louvain community detection or "max" for clustering based on the maximum row value; note that "max" is only appropriate for jrSiCKLSNMF with L2 norm row regularization

neighbors

Number indicating the number of neighbors to use to generate the graphs for spectral clustering and Louvain community detection: both of these methods require the construction of a graph first (here we use KNN); defaults to 20 and unused when the clustering method equal to "kmeans" or "max"

louvainres

Numeric containing the resolution parameter for Louvain community detection; unused for all other methods

References

louvainjrSiCKLSNMF

Lun2016jrSiCKLSNMF

Ng2001jrSiCKLSNMF

Schliep2016jrSiCKLSNMF

maxclusterjrSiCKLSNMF

Examples

Run this code
SimSickleJrSmall<-ClusterSickleJr(SimSickleJrSmall,3)
SimSickleJrSmall<-ClusterSickleJr(SimSickleJrSmall,method="louvain",neighbors=5)
SimSickleJrSmall<-ClusterSickleJr(SimSickleJrSmall,method="spectral",neighbors=5,numclusts=3)
#DO NOT DO THIS FOR REAL DATA; this is just to illustrate max clustering
SimSickleJrSmall<-SetLambdasandRowReg(SimSickleJrSmall,rowReg="L2Norm")
SimSickleJrSmall<-ClusterSickleJr(SimSickleJrSmall,method="max")

Run the code above in your browser using DataLab