kcca(flexclust)
kcca()所属R语言包:flexclust
K-Centroids Cluster Analysis
K-质心聚类分析
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Perform k-centroids clustering on a data matrix.
执行K-重心聚类数据矩阵。
用法----------Usage----------
kcca(x, k, family=kccaFamily("kmeans"), weights=NULL, group=NULL,
control=NULL, simple=FALSE, save.data=FALSE)
kccaFamily(which=NULL, dist=NULL, cent=NULL, name=which,
preproc = NULL, trim=0, groupFun = "minSumClusters")
## S4 method for signature 'kccasimple'
summary(object)
参数----------Arguments----------
参数:x
A numeric matrix of data, or an object that can be coerced to such a matrix (such as a numeric vector or a data frame with all numeric columns).
一个数字矩阵的数据或对象可以强制转换为一个矩阵(如一个数值向量或一个数据框的所有数值列)。
参数:k
Either the number of clusters, or a vector of cluster assignments, or a matrix of initial (distinct) cluster centroids. If a number, a random set of (distinct) rows in x is chosen as the initial centroids.
无论是聚类数或聚类分配的向量,或以矩阵的初始(不同的)聚类中心。如果选择一个数字,一组随机的(不同的)行x作为初始重心。
参数:family
Object of class kccaFamily.
对象类kccaFamily。
参数:weights
An optional vector of weights to be used in the clustering process, cannot be combined with all families.
一个可选的聚类过程中要使用的权重向量,不能结合所有家庭。
参数:group
An optional grouping vector for the data, see details below.
一个可选的分组的数据向量,详情如下。
参数:control
An object of class flexclustControl.
对象的类flexclustControl。
参数:simple
Return an object of class kccasimple?
返回对象类kccasimple吗?
参数:save.data
Save a copy of x in the return object?
保存一个副本x在返回的对象吗?
参数:which
One of "kmeans", "kmedians", "angle", "jaccard", or "ejaccard".
"kmeans","kmedians","angle","jaccard"或"ejaccard"之一。
参数:name
Optional long name for family, used only for show methods.
家庭可选的长名,仅用于显示的方法。
参数:dist
A function for distance computation, ignored if which is specified.
距离计算,忽略,如果which指定的功能。
参数:cent
A function for centroid computation, ignored if which is specified.
形心的计算,忽略,如果which指定的函数。
参数:preproc
Function for data preprocessing.
数据预处理的功能。
参数:trim
A number in between 0 and 0.5, if non-zero then trimmed means are used for the kmeans family, ignored by all other families.
许多在0和0.5之间,,如果非零然后修剪的方法用于kmeans家庭,忽略所有其他的家庭。
参数:groupFun
Function or name of function to obtain clusters for grouped data, see details below.
功能或函数的名字,,获得聚类分组数据,详情如下。
参数:object
Object of class "kcca".
对象类"kcca"。
Details
详细信息----------Details----------
See the paper A Toolbox for K-Centroids Cluster Analysis referenced below for details.
K-质心聚类分析参考下面的详细信息,请参阅纸工具箱。
值----------Value----------
Function kcca returns objects of class "kcca" or "kccasimple" depending on the value of argument simple. The simpler objects contain fewer slots and hence are faster to compute, but contain no auxiliary information used by the plotting methods. Most plot methods for "kccasimple" objects do nothing and return a warning. If only centroids, cluster membership or prediction for new data are of interest, then the simple objects are sufficient.
功能kcca返回的对象类"kcca"或"kccasimple"根据参数simple的价值。简单的对象包含较少的时隙,因此更快地计算,但不包含辅助的信息,所使用的绘图方法。多数绘图方法"kccasimple"对象什么也不做,返回一个警告。如果有兴趣,唯一的重心,新的聚类成员资格或预测数据那么简单对象就足够了。
预定义的家庭----------Predefined Families----------
Function kccaFamily() currently has the following predefined families (distance / centroid):
功能kccaFamily()目前有以下预定义的家庭(距离/心):
kmeans: Euclidean distance / mean
的kmeans:欧氏距离/平均
kmedians: Manhattan distance / median
kmedians:曼哈顿距离/中位数
angle: angle between observation and centroid / standardized
角度:角度观察和质心/标准间
jaccard: Jaccard distance / numeric optimization
杰卡德的Jaccard距离/数字优化
ejaccard: Jaccard distance / mean
ejaccard的Jaccard距离/平均
See Leisch (2006) for details on all combinations.
所有组合的详细信息,请参阅Leisch(2006)。
组约束----------Group Constraints----------
If group is not NULL, then observations from the same group are restricted to belong to the same cluster (must-link constraint) or different clusters (cannot-link constraint) during the fitting process. If groupFun = "minSumClusters", then all group members are assign to the cluster where the center has minimal average distance to the group members. If groupFun = "majorityClusters", then all group members are assigned to the cluster the majority would belong to without a constraint.
如果group非NULL,然后观测同一组被限制在属于同一个聚类(必须链接约束)在装修过程中或不同的聚类(是不可能链接约束)。如果groupFun = "minSumClusters",然后所有的小组成员分配到聚类中的中心组成员具有最小的平均距离。如果groupFun = "majorityClusters",然后所有的组成员分配到聚类中多数属于无约束。
groupFun = "differentClusters" implements a cannot-link constraint, i.e., members of one group are not allowed to belong to the same cluster. The optimal allocation for each group is found by solving a linear sum assignment problem using solve_LSAP. Obviously the group sizes must be smaller than the number of clusters in this case.
groupFun = "differentClusters"实现一个是不可能的链接约束,即,一组成员不属于同一个聚类。各组的优化配置,通过求解一个线性的使用和分配问题solve_LSAP。显然,其它组的大小必须小于在这种情况下,簇的数量。
Ties are broken at random in all cases. Note that at the moment not all methods for fitted "kcca" objects respect the grouping information, most importantly the plot method when a data argument is specified.
在所有情况下,随机关系被打破。请注意的是,目前并不是所有的方法装"kcca"对象尊重的分组信息,最重要的是图法当一个数据参数指定。
(作者)----------Author(s)----------
Friedrich Leisch
参考文献----------References----------
Computational Statistics and Data Analysis, 51 (2), 526–544, 2006.
algorithms to allow for group constraints. In Alfredo Rizzi and Maurizio Vichi, editors, Compstat 2006-Proceedings in Computational Statistics, pages 885-892. Physica Verlag, Heidelberg, Germany, 2006.
参见----------See Also----------
stepFlexclust, cclust
stepFlexclust,cclust
实例----------Examples----------
data("Nclus")
plot(Nclus)
## try kmeans [#尝试的kmeans]
cl1 = kcca(Nclus, k=4)
cl1
image(cl1)
points(Nclus)
## A barplot of the centroids [的的#A barplot的重心]
barplot(cl1)
## now use k-medians and kmeans++ initialization, cluster centroids[#现在使用K-中位数的kmeans + +初始化,聚类中心]
## should be similar...[#应该是类似的......]
cl2 = kcca(Nclus, k=4, family=kccaFamily("kmedians"),
control=list(initcent="kmeanspp"))
cl2
## ... but the boundaries of the partitions have a different shape[#...但分区的边界,有不同的形状]
image(cl2)
points(Nclus)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|