R新手在这里。我正在尝试在玻璃分类数据集(https://www.kaggle.com/uciml/glass)上使用mclust进行混合判别分析。基本上,数据包含7种不同类型的玻璃,其中9列表示玻璃中的化学物质(镁,铁等)数量。我正在尝试使用这9个变量来聚类并预测玻璃的类型。数据中没有缺失值。这是我尝试做的事情:
#Create scaled dataframe without the "Type Column" and call it x
x <- glass[,-10]
x <- scale(x)
x <- as.data.frame(x)
#Use a loop to create a list of every fourth value up to 212 (53 values total)
#i.e 4,8,12... 212
#Store these values as "glass_delete" (these are the index of rows to remove in the training set)
glass_delete<-rep(0,53)
k<-1
for(i in 1:dim(glass)[1]){
if(i%%4==0){glass_delete[k]<-i; k<-k+1}
}
#Use Mclust to use the training set (without 53 observations) to predict the test set
*glassMclustDA <- MclustDA(x[-glass_delete,], glass[-glass_delete,10])
summary(glassMclustDA, parameters = TRUE)
summary(glassMclustDA, newdata = x[glass_delete,], newclass = glass[glass_delete,10])
当我尝试运行加星号的行(最后一行)时,出现错误消息,告诉我“ BLAS / LAPACK例程'DGESVD'给出了错误代码-13”。我到处都看了,不知道这意味着什么。我的代码将Class 1适配到Class 5很好,然后当它尝试适配Class 6时出现此错误。我已经为此苦苦挣扎了两个小时,无法解决。任何建议表示赞赏。