首先,让我们看一下mydata
:
head(mydata,10)
LONGITUDE LATITUDE
1 121.7779 39.0476
2 121.5210 38.8771
3 121.6259 38.9224
4 121.5907 38.8980
5 121.5865 38.8816
6 121.5808 38.9121
7 121.5806 38.8843
8 121.5907 38.8992
9 121.7586 39.0380
10 121.6061 38.9035
dim(mydata)
[1] 716213 2
summary(mydata)
LONGITUDE LATITUDE
Min. :121.1 Min. :38.72
1st Qu.:121.6 1st Qu.:38.91
Median :121.6 Median :38.93
Mean :121.6 Mean :38.95
3rd Qu.:121.6 3rd Qu.:38.99
Max. :122.2 Max. :39.40
mydata 的整体大小小于 20Mb。
现在,我想用 mydata 进行集群,我Mclust()
在 package中使用mclust
,这被称为 EM(期望最大化)。
fit_em <- Mclust(mydata)
令我惊讶的是,在我输入代码后,我等了一个多小时才得到结果,是一个错误。详细信息是:
Error: cannot allocate vector of size 1910.9 Gb
In addition: Warning messages:
1: In hcVVV(data = c(121.7779, 121.521, 121.6259, 121.5907, 121.5865, :
NAs introduced by coercion to integer range
2: In double(ld) :
Reached total allocation of 8191Mb: see help(memory.size)
3: In double(ld) :
Reached total allocation of 8191Mb: see help(memory.size)
4: In double(ld) :
Reached total allocation of 8191Mb: see help(memory.size)
5: In double(ld) :
Reached total allocation of 8191Mb: see help(memory.size)
mydata和我的代码出了什么问题,如果我想用mydata进行集群怎么办?