Skip to contents

Perform spectral clustering for a different combinations of indices and kernels

Usage

clustInd_spc(
  ind_data,
  vars_combinations,
  kernel_list = c("rbfdot", "polydot"),
  n_cluster = 2,
  true_labels = NULL,
  n_cores = 1
)

Arguments

ind_data

Dataframe containing indices applied to the original data and its first and second derivatives. See generate_indices.

vars_combinations

list containing one or more combinations of indices in ind_data. If it is non-named, the names of the variables are set to vars1, ..., varsk, where k is the number of elements in vars_combinations.

kernel_list

List of kernels

n_cluster

Number of clusters to create

true_labels

Vector of true labels for validation (if it is not known true_labels is set to NULL)

n_cores

Number of cores to do parallel computation. 1 by default, which mean no parallel execution.

Value

A list containing kkmeans clustering results for each configuration

Examples

vars1 <- c("dtaEI", "dtaMEI")
vars2 <- c("dtaHI", "dtaMHI")
data <- ehymet::sim_model_ex1()
data_ind <- generate_indices(data)
clustInd_spc(data_ind, list(vars1, vars2))
#> $spc_rbfdot_dtaEIdtaMEI
#> $spc_rbfdot_dtaEIdtaMEI$cluster
#>   [1] 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 1 2 2 2 2 2 2 2 2 2 2 2 2
#>  [38] 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
#>  [75] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
#> 
#> $spc_rbfdot_dtaEIdtaMEI$internal_metrics
#> $spc_rbfdot_dtaEIdtaMEI$internal_metrics$davies_bouldin
#> [1] 0.4369024
#> 
#> $spc_rbfdot_dtaEIdtaMEI$internal_metrics$dunn
#> [1] 0.1199688
#> 
#> $spc_rbfdot_dtaEIdtaMEI$internal_metrics$silhouette
#> [1] 0.6524221
#> 
#> $spc_rbfdot_dtaEIdtaMEI$internal_metrics$infomax
#> [1] 0.2422922
#> 
#> 
#> $spc_rbfdot_dtaEIdtaMEI$time
#> [1] 0.2211072
#> 
#> 
#> $spc_rbfdot_dtaHIdtaMHI
#> $spc_rbfdot_dtaHIdtaMHI$cluster
#>   [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#>  [38] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1
#>  [75] 1 1 2 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 2 1 1 1 1 1 1
#> 
#> $spc_rbfdot_dtaHIdtaMHI$internal_metrics
#> $spc_rbfdot_dtaHIdtaMHI$internal_metrics$davies_bouldin
#> [1] 0.3600565
#> 
#> $spc_rbfdot_dtaHIdtaMHI$internal_metrics$dunn
#> [1] 0.114942
#> 
#> $spc_rbfdot_dtaHIdtaMHI$internal_metrics$silhouette
#> [1] 0.7156103
#> 
#> $spc_rbfdot_dtaHIdtaMHI$internal_metrics$infomax
#> [1] 0.3274449
#> 
#> 
#> $spc_rbfdot_dtaHIdtaMHI$time
#> [1] 0.05546641
#> 
#> 
#> $spc_polydot_dtaEIdtaMEI
#> $spc_polydot_dtaEIdtaMEI$cluster
#>   [1] 2 2 1 1 2 1 2 1 1 1 2 1 1 2 2 1 2 2 2 2 2 2 1 2 1 1 2 1 2 2 2 2 2 2 1 2 1
#>  [38] 2 2 2 2 2 1 2 2 1 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
#>  [75] 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2
#> 
#> $spc_polydot_dtaEIdtaMEI$internal_metrics
#> $spc_polydot_dtaEIdtaMEI$internal_metrics$davies_bouldin
#> [1] 0.5877327
#> 
#> $spc_polydot_dtaEIdtaMEI$internal_metrics$dunn
#> [1] 0.122693
#> 
#> $spc_polydot_dtaEIdtaMEI$internal_metrics$silhouette
#> [1] 0.5716023
#> 
#> $spc_polydot_dtaEIdtaMEI$internal_metrics$infomax
#> [1] 0.7414827
#> 
#> 
#> $spc_polydot_dtaEIdtaMEI$time
#> [1] 0.05874968
#> 
#> 
#> $spc_polydot_dtaHIdtaMHI
#> $spc_polydot_dtaHIdtaMHI$cluster
#>   [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
#>  [38] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2
#>  [75] 2 2 1 2 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 2
#> 
#> $spc_polydot_dtaHIdtaMHI$internal_metrics
#> $spc_polydot_dtaHIdtaMHI$internal_metrics$davies_bouldin
#> [1] 0.3600565
#> 
#> $spc_polydot_dtaHIdtaMHI$internal_metrics$dunn
#> [1] 0.114942
#> 
#> $spc_polydot_dtaHIdtaMHI$internal_metrics$silhouette
#> [1] 0.7156103
#> 
#> $spc_polydot_dtaHIdtaMHI$internal_metrics$infomax
#> [1] 0.3274449
#> 
#> 
#> $spc_polydot_dtaHIdtaMHI$time
#> [1] 0.05606031
#> 
#>