# NOT RUN {
library(cuml)
library(magrittr)
gen_pts <- function() {
centroids <- list(c(1000, 1000), c(-1000, -1000), c(-1000, 1000))
pts <- centroids %>%
purrr::map(
~ MASS::mvrnorm(10, mu = .x, Sigma = matrix(c(1, 0, 0, 1), nrow = 2))
)
rlang::exec(rbind, !!!pts)
}
m <- gen_pts()
clusters <- cuml_dbscan(m, min_pts = 5, eps = 3)
print(clusters)
# }
Run the code above in your browser using DataLab