我正在尝试使用函数specc()
进行光谱聚类。有一些问题。有人可以解释/修复下面的代码。文档在这里 - https://rdrr.io/cran/kernlab/man/specc.html
install.packages("kernlab")
library(kernlab)
# 1. matrix
x = matrix(runif(100), nrow = 10)
# spectral clustering
sc <- specc(x, centers = 4)
# 1. tibble
tbl = tibble(x = runif(100), y = runif(100))
# spectral clustering
sc <- specc(tbl, centers = 4)
# Example in documentation workd perfectly fine
data(spirals)
SC <- specc(spirals, centers=2)
SC