我使用以下 tsclust 语句对数据进行聚类
SURFSKINTEMP_CLUST <- tsclust(SURFSKINTEMP, k = 10L:20L,
distance = "dtw_basic", centroid = "dba",
trace = TRUE, seed = 938,
norm = "L2", window.size = 2L,
args = tsclust_args(cent = list(trace = TRUE)))
SURFSKINTEMP 很大,
str(SURFSKINTEMP)
List of 327239
$ V1 : num [1:7] 0.13 0.631 -0.178 0.731 0.86 ...
$ V2 : num [1:6] 0.117 -0.693 -0.911 -0.911 -0.781 ...
$ V3 : num [1:7] 0.117 -0.693 -0.911 -0.911 -0.781 ...
$ V4 : num [1:6] -0.693 -0.911 -0.911 -0.781 -0.604 ...
然后,我想使用 cvi 来评估最佳聚类数“k”</p>
names(SURFSKINTEMP_CLUST) <- paste0("k_",10L:20L)
sapply(SURFSKINTEMP_CLUST, cvi, type = "internal")
但是,有一个错误
> sapply(SURFSKINTEMP_CLUST, cvi, type = "internal")
Error: cannot allocate vector of size 797.8 Gb
在我的情况下,我如何评估最佳聚类数“k”?