fanny(cluster)
fanny()所属R语言包:cluster
Fuzzy Analysis Clustering
模糊分析聚类
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Computes a fuzzy clustering of the data into k clusters.
计算了成k集群数据的模糊聚类。
用法----------Usage----------
fanny(x, k, diss = inherits(x, "dist"), memb.exp = 2,
metric = c("euclidean", "manhattan", "SqEuclidean"),
stand = FALSE, iniMem.p = NULL, cluster.only = FALSE,
keep.diss = !diss && !cluster.only && n < 100,
keep.data = !diss && !cluster.only,
maxit = 500, tol = 1e-15, trace.lev = 0)
参数----------Arguments----------
参数:x
data matrix or data frame, or dissimilarity matrix, depending on the value of the diss argument. In case of a matrix or data frame, each row corresponds to an observation, and each column corresponds to a variable. All variables must be numeric. Missing values (NAs) are allowed. In case of a dissimilarity matrix, x is typically the output of daisy or dist. Also a vector of length n*(n-1)/2 is allowed (where n is the number of observations), and will be interpreted in the same way as the output of the above-mentioned functions. Missing values (NAs) are not allowed.
数据矩阵或数据框,或相异矩阵,根据上diss参数值。在一个矩阵或数据框的情况下,每一行对应一个观察,每列对应一个变量。所有的变量必须是数字。遗漏值(NAS)是允许的。在一个相异矩阵的情况下,x通常是daisy或dist输出。也被允许长度为n *(N-1)/ 2矢量(其中n为若干意见),将在上述功能的输出相同的方式解释。遗漏值(NAS)是不允许的。
参数:k
integer giving the desired number of clusters. It is required that 0 < k < n/2 where n is the number of observations.
整数,所需数量的集群。这是要求0 < k < n/2其中n的若干意见。
参数:diss
logical flag: if TRUE (default for dist or dissimilarity objects), then x is assumed to be a dissimilarity matrix. If FALSE, then x is treated as a matrix of observations by variables.
逻辑标志:如果为TRUE(默认为dist或dissimilarity对象),然后x假设是相异矩阵。如果为FALSE,那么x被视为一个由变量的观测矩阵。
参数:memb.exp
number r strictly larger than 1 specifying the membership exponent used in the fit criterion; see the "Details" below. Default: 2 which used to be hardwired inside FANNY.
数量r严格指定的成员在合适的标准指数大于1;看到下面的“详细资料”。默认:2这内范妮硬。
参数:metric
character string specifying the metric to be used for calculating dissimilarities between observations. Options are "euclidean" (default), "manhattan", and "SqEuclidean". Euclidean distances are root sum-of-squares of differences, and manhattan distances are the sum of absolute differences, and "SqEuclidean", the squared euclidean distances are sum-of-squares of differences. Using this last option is equivalent (but somewhat slower) to computing so called “fuzzy C-means”. <br> If x is already a dissimilarity matrix, then this argument will be ignored.
字符串指定的度量用于计算之间的意见异同。选项是"euclidean"(默认),"manhattan","SqEuclidean"。欧氏距离总和的平方差异的根源,和曼哈顿距离是绝对差异的总和,和"SqEuclidean",平方欧氏距离差异平方的总和。利用这最后的选项是等效(但有点慢)所谓的“模糊C-均值”计算。 <br>如果x已经是一个相异矩阵,那么这个参数将被忽略。
参数:stand
logical; if true, the measurements in x are standardized before calculating the dissimilarities. Measurements are standardized for each variable (column), by subtracting the variable's mean value and dividing by the variable's mean absolute deviation. If x is already a dissimilarity matrix, then this argument will be ignored.
逻辑,如果属实,测量x前计算的异同标准化。测量是为每个变量(列)减去变量的平均值除以变量的平均绝对偏差,标准化。 x如果已经是一个相异矩阵,那么这个参数将被忽略。
参数:iniMem.p
numeric n * k matrix or NULL (by default); can be used to specify a starting membership matrix, i.e., a matrix of non-negative numbers, each row summing to one. </table>
数字n * k矩阵或NULL(默认);可以用来指定一个起点membership矩阵,也就是说,一个非负数的矩阵,每行一个总结。 </ TABLE>
参数:cluster.only
logical; if true, no silhouette information will be computed and returned, see details. </table>
逻辑;如果属实,没有人影信息将被计算并返回,查看详细信息。 </ TABLE>
参数:keep.diss, keep.data
logicals indicating if the dissimilarities and/or input data x should be kept in the result. Setting these to FALSE can give smaller results and hence also save memory allocation time.
逻辑值表示的异同和/或输入数据x应保持在结果。这些设置FALSE可以给小的结果,因此还可以节省内存分配时间。
参数:maxit, tol
maximal number of iterations and default tolerance for convergence (relative convergence of the fit criterion) for the FANNY algorithm. The defaults maxit = 500 and tol = 1e-15 used to be hardwired inside the algorithm.
迭代收敛的范妮算法(合适的标准相衔接)的耐受性和默认的最大数量。默认maxit = 500和tol = 1e-15里面的算法硬。
参数:trace.lev
integer specifying a trace level for printing diagnostics during the C-internal algorithm. Default 0 does not print anything; higher values print increasingly more.
整数,指定跟踪级别,打印在内部的C-算法的诊断。默认的0不打印任何东西;值越高打印越来越多。
Details
详情----------Details----------
In a fuzzy clustering, each observation is “spread out” over the various clusters. Denote by u(i,v) the membership of observation i to cluster v.
在模糊聚类,每个观察“摊开”在各种集群。记u(i,v)观察会员i集群v。
The memberships are nonnegative, and for a fixed observation i they sum to 1. The particular method fanny stems from chapter 4 of Kaufman and Rousseeuw (1990) (see the references in daisy) and has been extended by Martin Maechler to allow user specified memb.exp, iniMem.p, maxit, tol, etc.
成员都是非负,和一个固定的观察,我总结1。特定的方法fanny源于章考夫曼和Rousseeuw的(1990)4(见daisy的参考文献),并已由马丁Maechler延长允许用户指定memb.exp,<X >,iniMem.p,maxit等。
Fanny aims to minimize the objective function
范妮的目的是最小化的目标函数
where n is the number of observations, k is the number of clusters, r is the membership exponent memb.exp and d(i,j) is the dissimilarity between observations i and j. <br> Note that r -> 1 gives increasingly crisper clusterings whereas r -> Inf leads to complete fuzzyness. K\&R(1990), p.191 note that values too close to 1 can lead to slow convergence. Further note that even the default, r = 2 can lead to complete fuzzyness, i.e., memberships u(i,v) == 1/k. In that case a warning is signalled and the user is advised to chose a smaller memb.exp (=r).
n的若干意见,k是数字集群,r是会员指数memb.exp和d(i,j)是观测之间的相异i和j。 <br>请注意,r -> 1给越来越明快的聚类,而r -> Inf导致完成fuzzyness的。 K \&R的(1990),p.191注意,太值接近1,可导致收敛速度慢。进一步指出,即使是默认的,r = 2可导致完成fuzzyness,即,成员u(i,v) == 1/k。在这种情况下,一个警告信号,并且建议用户选择一个较小的memb.exp(=r)。
Compared to other fuzzy clustering methods, fanny has the following features: (a) it also accepts a dissimilarity matrix; (b) it is more robust to the spherical cluster assumption; (c) it provides a novel graphical display, the silhouette plot (see plot.partition).
其他模糊聚类方法相比,fanny具有以下特点:(一)接受相异矩阵;(b)它是更强大的spherical cluster假设;(三)提供了一种新图形显示,剪影图(见plot.partition)。
值----------Value----------
an object of class "fanny" representing the clustering. See fanny.object for details.
类"fanny"代表聚类的对象。看到fanny.object详情。
参见----------See Also----------
agnes for background and references; fanny.object, partition.object, plot.partition, daisy, dist.
agnes背景和参考; fanny.object,partition.object,plot.partition,daisy,dist。
举例----------Examples----------
## generate 10+15 objects in two clusters, plus 3 objects lying[#产生10 +15两个集群的对象,再加上3个物体躺在]
## between those clusters.[#之间的集群。]
x <- rbind(cbind(rnorm(10, 0, 0.5), rnorm(10, 0, 0.5)),
cbind(rnorm(15, 5, 0.5), rnorm(15, 5, 0.5)),
cbind(rnorm( 3,3.2,0.5), rnorm( 3,3.2,0.5)))
fannyx <- fanny(x, 2)
## Note that observations 26:28 are "fuzzy" (closer to # 2):[#注意观察26:28是“模糊”(接近2#):]
fannyx
summary(fannyx)
plot(fannyx)
(fan.x.15 <- fanny(x, 2, memb.exp = 1.5)) # 'crispier' for obs. 26:28[crispier的OBS。 26:28]
(fanny(x, 2, memb.exp = 3)) # more fuzzy in general[一般更模糊]
data(ruspini)
f4 <- fanny(ruspini, 4)
stopifnot(rle(f4$clustering)$lengths == c(20,23,17,15))
plot(f4, which = 1)
## Plot similar to Figure 6 in Stryuf et al (1996)[#绘制类似于图6中Stryuf等(1996)]
plot(fanny(ruspini, 5))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|