powered by
Run the K means clustering algorithm.
cuml_kmeans(x, k, max_iters = 300)
The input matrix or dataframe. Each data point should be a row and should consist of numeric values only.
The number of clusters.
Maximum number of iterations (default: 300).
A list containing the cluster assignments and the centroid of each cluster. Each centroid will be a column within the `centroids` matrix.
# NOT RUN { library(cuml4r) kclust <- cuml_kmeans( iris[, which(names(iris) != "Species")], k = 3, max_iters = 100 ) print(kclust) # }
Run the code above in your browser using DataLab