Skip to contents

Clustering initialization

Usage

clustinit_LBM(connectivity, Q1, Q2, type = "hierarchical_clust")

Arguments

connectivity

Binary matrix

Q1

number of clusters for rows

Q2

number of clusters for columns

type

type of initialization : "hierarchical_clust", "spectral_clust" or "kmeans_clust"

Value

List containing an initial clustering for rows and columns

Examples

a<- matrix(0,10,10)
a[1:5,1:5] = runif(25)<0.9
a[6:10,1:5] = runif(25)<0.5
a[1:5,6:10] = runif(25)<0.3
a[6:10,6:10] = runif(25)<0.1
print(a)
#>       [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#>  [1,]    0    1    1    1    1    0    1    0    1     0
#>  [2,]    1    1    1    1    0    0    0    0    1     0
#>  [3,]    1    1    0    0    1    0    0    0    1     0
#>  [4,]    1    1    1    1    1    0    1    0    1     0
#>  [5,]    1    1    1    1    1    0    0    0    0     0
#>  [6,]    0    1    0    0    1    0    0    0    0     0
#>  [7,]    0    0    0    0    1    0    0    0    0     1
#>  [8,]    1    0    0    1    0    0    0    0    0     0
#>  [9,]    1    0    1    1    1    1    0    0    0     0
#> [10,]    0    1    1    1    1    0    0    0    0     1
print(clustinit_LBM(a,2,2))
#> [[1]]
#>  [1] 1 1 2 1 1 2 2 1 1 2
#> 
#> [[2]]
#>  [1] 1 1 1 1 1 2 2 2 2 2
#>