kernel_kmeans: Kernel k-means

View source: R/kernels.R

kernel_kmeansR Documentation

Kernel k-means

Description

Kernel k-means with different algorithm options. Spectral relaxation uses standard randomly initialized k-means on the eigen vectors of the kernel matrix while the QR decomposition of the eigen vectors yields a single solution directly. The last option is to use the kernel matrix to optimize average distances without utilizing the spectral relaxation.

Usage

kernel_kmeans(
  K,
  n_k,
  algorithm = "spectral_qr",
  spectral_qr_refine = TRUE,
  kernel_eigen_vectors = NULL,
  max_iter = 100,
  num_init = 100,
  tol = 1e-08,
  parallel = 1,
  ...
)

Arguments

K

kernel matrix

n_k

number of clusters

algorithm

one of "spectral", "spectral_qr", or "kernelized"

spectral_qr_refine

refine QR result with kernelized k-means

kernel_eigen_vectors

eigenvectors of the kernel matrix can be pre-computed

max_iter

maximum number of iterations

num_init

number of kmeans++ initializations for kernelized k-means and spectral clustering

tol

delta error convergence threshold for spectral clustering

parallel

number of threads for kernelized_kmeans

...

ignored

Details

The tol parameter is only used by the spectral relaxation algorithm which makes use of KMeans_rcpp. Other iterative algorithms are considered converged only if cluster assignments do not change.

Value

list of cluster assignments and k-means objective


vittoriofortino84/COPS documentation built on Jan. 28, 2025, 3:16 p.m.