Description Usage Arguments Value Author(s) References Examples
Perform the training step of kernel k-means.
1 | kkmeans(K, parameters)
|
K |
Kernel matrix. |
parameters |
A list containing the number of clusters
|
This function returns a list containing:
clustering |
the cluster labels for each element (i.e. row/column) of the kernel matrix. |
objective |
the value of the objective function for the given clustering. |
parameters |
same parameters as in the input. |
Mehmet Gonen
Gonen, M. and Margolin, A.A., 2014. Localized data fusion for kernel k-means clustering with application to cancer biology. In Advances in Neural Information Processing Systems (pp. 1305-1313).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Load one dataset with 100 observations, 2 variables, 4 clusters
data <- as.matrix(read.csv(system.file("extdata", "dataset1.csv",
package = "klic"), row.names = 1))
# Compute consensus clustering with K=4 clusters
cm <- coca::consensusCluster(data, 4)
# Shift eigenvalues of the matrix by a constant: (min eigenvalue) * (coeff)
km <- spectrumShift(cm, coeff = 1.05)
# Initalize the parameters of the algorithm
parameters <- list()
# Set the number of clusters
parameters$cluster_count <- 4
# Perform training
state <- kkmeans(km, parameters)
# Display the clustering
print(state$clustering)
|
[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 3 3 3 3 3 3 3 3 3 3 3 3
[38] 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
[75] 4 2 2 2 2 2 2 2 2 4 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.