trimkmeans(trimcluster)
trimkmeans()所属R语言包:trimcluster
Trimmed k-means clustering
修剪k-means聚类
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The trimmed k-means clustering method by Cuesta-Albertos, Gordaliza and Matran (1997). This optimizes the k-means criterion under trimming a portion of the points.
修整后的k-means聚类方法Cuesta的Albertos,Gordaliza和Matran(1997年)。这优化了根据修剪的点的一部分的k-means准则。
用法----------Usage----------
trimkmeans(data,k,trim=0.1, scaling=FALSE, runs=100, points=NULL,
countmode=runs+1, printcrit=FALSE,
maxit=2*nrow(as.matrix(data)))
## S3 method for class 'tkm':
print(x, ...)
## S3 method for class 'tkm':
plot(x, data, ...)
参数----------Arguments----------
参数:data
matrix or data.frame with raw data
与原始数据矩阵或数据框
参数:k
integer. Number of clusters.
整数。聚类数。
参数:trim
numeric between 0 and 1. Proportion of points to be trimmed.
0和1之间的数字。点比例进行修整。
参数:scaling
logical. If TRUE, the variables are centered at their means and scaled to unit variance before execution.
逻辑。如果TRUE,变量都集中在他们的手段,并扩展到单位方差之前执行。
参数:runs
integer. Number of algorithm runs from initial means (randomly chosen from the data points).
整数。一些算法运行从初始装置(随机选择从数据点)。
参数:points
NULL or a matrix with k vectors used as means to initialize the algorithm. If initial mean vectors are specified, runs should be 1 (otherwise the same initial means are used for all runs).
NULL或用作具有k向量的矩阵装置初始化该算法。如果初始的平均向量被指定,runs应该是1(否则相同的初始装置被用于所有的运行)。
参数:countmode
optional positive integer. Every countmode algorithm runs trimkmeans shows a message.
可选的正整数。每countmode算法的运行trimkmeans显示一条消息。
参数:printcrit
logical. If TRUE, all criterion values (mean squares) of the algorithm runs are printed.
逻辑。如果TRUE,所有的算法运行的标准值(均方)印刷。
参数:maxit
integer. Maximum number of iterations within an algorithm run. Each iteration determines all points which are closer to a different cluster center than the one to which they are currently assigned. The algorithm terminates if no more points have to be reassigned, or if maxit is reached.
整数。的最大数目的迭代内的算法运行。每一次迭代确定的所有点,比他们目前分配到不同的聚类中心。算法终止,如果没有更多的积分,必须重新分配,,或者如果maxit达到。
参数:x
object of class tkm.
对象类tkm。
参数:...
further arguments to be transferred to plot or plotcluster.
进一步的论据被转移到plot或plotcluster。
Details
详细信息----------Details----------
plot.tkm calls plotcluster if the dimensionality of the data p is 1, shows a scatterplot with non-trimmed regions if p=2 and discriminant coordinates computed from the clusters (ignoring the trimmed points) if p>2.
plot.tkm调用plotcluster,如果维数的数据p1,显示的散点图与非修剪的区域,如果p=2和判别坐标计算聚类(忽略修剪点)如果p>2。
值----------Value----------
An object of class 'tkm' which is a LIST with components <table summary="R valueblock"> <tr valign="top"><td>classification</td> <td> integer vector coding cluster membership with trimmed observations coded as k+1.</td></tr> <tr valign="top"><td>means</td> <td> numerical matrix giving the mean vectors of the k classes.</td></tr> <tr valign="top"><td>disttom</td> <td> vector of squared Euclidean distances of all points to the closest mean.</td></tr> <tr valign="top"><td>ropt</td> <td> maximum value of disttom so that the corresponding point is not trimmed.</td></tr> <tr valign="top"><td>k</td> <td> see above.</td></tr> <tr valign="top"><td>trim</td> <td> see above.</td></tr> <tr valign="top"><td>runs</td> <td> see above.</td></tr> <tr valign="top"><td>scaling</td> <td> see above.</td></tr> </table>
一个对象类“吨公里”,这是一个组件<table summary="R valueblock"> <tr valign="top"> <TD> classification</ TD> <TD>整数向量编码的聚类成员列表,修剪观察编码为k+1。</ TD> </ TR> <tr valign="top"> <TD> means </ TD> <TD>数值矩阵给出的平均矢量k类。</ TD> </ TR> <tr valign="top"> <TD>disttom</ TD> <TD>向量的欧氏距离平方的所有点到最近的平均。</ TD > </ TR> <tr valign="top"> <TD>ropt </ TD> <TD>最大值disttom所以不会修剪对应点。</ TD> < / TR> <tr valign="top"> <TD> k </ TD> <TD>上面看到的。</ TD> </ TR> <tr valign="top"> <TD> X> </ TD> <TD>上面看到的。</ TD> </ TR> <tr valign="top"> <TD> trim</ TD> <TD>以上。</ TD > </ TR> <tr valign="top"> <TD>runs </ TD> <TD>上面看到的。</ TD> </ TR> </ TABLE>
(作者)----------Author(s)----------
Christian Hennig
<a href="mailto:chrish@stats.ucl.ac.uk">chrish@stats.ucl.ac.uk</a>
<a href="http://www.homepages.ucl.ac.uk/~ucakche/">http://www.homepages.ucl.ac.uk/~ucakche/</a>
参考文献----------References----------
Cuesta-Albertos, J. A., Gordaliza, A., and Matran, C. (1997) Trimmed k-Means: An Attempt to Robustify Quantizers, Annals of Statistics, 25, 553-576.
参见----------See Also----------
plotcluster
plotcluster
实例----------Examples----------
set.seed(10001)
n1 <-60
n2 <-60
n3 <-70
n0 <-10
nn <- n1+n2+n3+n0
pp <- 2
X <- matrix(rep(0,nn*pp),nrow=nn)
ii <-0
for (i in 1:n1){
ii <-ii+1
X[ii,] <- c(5,-5)+rnorm(2)
}
for (i in 1:n2){
ii <- ii+1
X[ii,] <- c(5,5)+rnorm(2)*0.75
}
for (i in 1:n3){
ii <- ii+1
X[ii,] <- c(-5,-5)+rnorm(2)*0.75
}
for (i in 1:n0){
ii <- ii+1
X[ii,] <- rnorm(2)*8
}
tkm1 <- trimkmeans(X,k=3,trim=0.1,runs=3)
# runs=3 is used to save computing time.[运行= 3,以节省计算时间。]
print(tkm1)
plot(tkm1,X)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|