- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想确定使用 NbClust 包进行聚类的最佳 k。我的数据同时具有连续变量和分类变量,因此我使用了使用集群包中的 daisy() 计算的相异矩阵。我使用了下面的代码:
res.nb <- NbClust(gower_dist_gender, min.nc = 1,
max.nc = 5,method = "complete", index ="all")
The TSS matrix is indefinite. There must be too many missing values. The
index cannot be calculated.
最佳答案
您对 NbClust 的调用是错误的。
请参阅有关如何使用距离矩阵而不是数据矩阵的文档:
data
matrix or dataset.
diss
dissimilarity matrix to be used. By default, diss=NULL, but if it is replaced by a dissimilarity matrix, distance should be "NULL".
distance
the distance measure to be used to compute the dissimilarity matrix. This must be one of: "euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski" or "NULL". By default, distance="euclidean". If the distance is "NULL", the dissimilarity matrix (diss) should be given by the user. If distance is not "NULL", the dissimilarity matrix should be "NULL".
关于r - "The TSS matrix is indefinite. There must be too many missing values. The index cannot be calculated "使用 nbclust 时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46067602/
我是一名优秀的程序员,十分优秀!