Description Usage Arguments Value Author(s) References Examples
View source: R/lmkkmeans_missingData.R
Perform the training step of the localised multiple kernel k-means.
1 | lmkkmeans_missingData(Km, parameters, missing = NULL, verbose = FALSE)
|
Km |
Array of size N X N X M containing M different N x N kernel matrices. |
parameters |
A list of parameters containing the desired number of
clusters, |
missing |
Matrix of size N X M containing missingness indicators, i.e.
missing[i,j] = 1 (or = TRUE) if observation |
verbose |
Boolean flag. If TRUE, at each iteration the iteration number is printed. Defaults to FALSE. |
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. |
Theta |
N x M matrix of weights, each row corresponds to an observation and each column to one of the kernels. |
Mehmet Gonen, Alessandra Cabassi
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 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | if(requireNamespace("Rmosek", quietly = TRUE) &&
(!is.null(utils::packageDescription("Rmosek")$Configured.MSK_VERSION))){
# Intialise 100 x 100 x 3 array containing M kernel matrices
# representing three different types of similarities between 100 data points
km <- array(NA, c(100, 100, 3))
# Load kernel matrices
km[,,1] <- as.matrix(read.csv(system.file('extdata',
'kernel_matrix1.csv', package = 'klic'), row.names = 1))
km[,,2] <- as.matrix(read.csv(system.file('extdata',
'kernel_matrix2.csv', package = 'klic'), row.names = 1))
km[,,3] <- as.matrix(read.csv(system.file('extdata',
'kernel_matrix3.csv', package = 'klic'), row.names = 1))
# Introduce some missing data
km[76:80, , 1] <- NA
km[, 76:80, 1] <- NA
# Define missingness indicators
missing <- matrix(FALSE, 100, 3)
missing[76:80,1] <- TRUE
# Initalize the parameters of the algorithm
parameters <- list()
# Set the number of clusters
parameters$cluster_count <- 4
# Set the number of iterations
parameters$iteration_count <- 10
# Perform training
state <- lmkkmeans_missingData(km, parameters, missing)
# Display the clustering
print(state$clustering)
# Display the kernel weights
print(state$Theta)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.