KMeansSparseCluster(sparcl)
KMeansSparseCluster()所属R语言包:sparcl
Performs sparse k-means clustering
执行稀疏的k-means聚类
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function performs sparse k-means clustering. You must specify a number of clusters K and an L1 bound on w, the feature weights.
这个函数执行稀疏的k-means聚类。您必须指定一个数字聚类K和W,要素权重绑定在L1。
用法----------Usage----------
KMeansSparseCluster(x, K=NULL, wbounds = NULL, nstart = 20, silent =
FALSE, maxiter=6, centers=NULL)
参数----------Arguments----------
参数:x
An nxp data matrix. There are n observations and p features.
恩智浦的数据矩阵。有N个观测值和P功能。
参数:K
The number of clusters desired ("K" in K-means clustering). Must provide either K or centers.
所需的簇的数目(K-means聚类中的“K”)。必须提供要么K或中心。
参数:wbounds
A single L1 bound on w (the feature weights), or a vector of L1 bounds on w. If wbound is small, then few features will have non-zero weights. If wbound is large then all features will have non-zero weights. Should be greater than 1.
一个单一的L1,瓦特(特征权重),或一个矢量的L1的界限在W上的约束。如果wbound是小的,然后几个特点将有非零的权重。如果wbound大,那么所有的功能将有非零的权重。应该是大于1。
参数:nstart
The number of random starts for the k-means algorithm.
随机启动的k-means算法的数量。
参数:silent
Print out progress?
打印出的进展如何?
参数:maxiter
The maximum number of iterations.
最大迭代次数。
参数:centers
Optional argument. If you want to run the k-means algorithm starting from a particular set of clusters, then you can enter the Kxp matrix of cluster centers here. Default use case involves taking centers=NULL and instead specifying K.
可选参数。如果你想运行的k-means算法从一组特定的聚类,然后你就可以进入KXP矩阵的聚类中心。默认情况下使用的情况下,涉及到中心= NULL,而不是指定K.
Details
详细信息----------Details----------
We seek a p-vector of weights w (one per feature) and a set of clusters C1,...,CK that optimize
我们寻求对权重向量W(每一个功能)和一组聚类C1,...,CK,优化
$maximize_C1,...,CK,w sum_j w_j BCSS_j$ subject to $||w||_2 <= 1, ||w||_1 <= wbound, w_j >= 0$
$ maximize_C1,...,CK,W sum_j w_j BCSS_j $ $ | |瓦特| | _2 <= 1,| |瓦特| | _1 = wbound,w_j> = 0 $
where $BCSS_j$ is the between cluster sum of squares for feature j. An iterative approach is taken: with w fixed, optimize with respect to C1,...,CK, and with C1,...,CK fixed, optimize with respect to w. Here, wbound is a tuning parameter which determines the L1 bound on w.
BCSS_j $之间的聚类特征j的平方之和。迭代的方法采取:用w固定的,相对于优化为C1,...,CK,并与C1,...,CK固定的,相对于优化为w。在这里,wbound是调整参数,它决定了L1 W上的约束。
The non-zero elements of w indicate features that are used in the sparse clustering.
为w的非零元素表示稀疏聚类中所使用的功能。
值----------Value----------
If wbounds is a vector, then a list with elements as follows (one per element of wbounds). If wbounds is just a single value, then elements as follows:
如果wbounds是一个向量的列表,然后与如下(每个元素wbounds一个)元素。 ,如果wbounds只是一个单一的值,然后元素如下:
参数:ws
The p-vector of feature weights.
的p-的特征权重向量。
参数:Cs
The clustering obtained.
聚类。
(作者)----------Author(s)----------
Daniela M. Witten and Robert Tibshirani
参考文献----------References----------
参见----------See Also----------
KMeansSparseCluster.permute,HierarchicalSparseCluster
KMeansSparseCluster.permute,HierarchicalSparseCluster
实例----------Examples----------
# generate data[生成数据]
set.seed(11)
x <- matrix(rnorm(50*300),ncol=300)
x[1:25,1:50] <- x[1:25,1:50]+1
x <- scale(x, TRUE, TRUE)
# choose tuning parameter[选择调整参数]
km.perm <- KMeansSparseCluster.permute(x,K=2,wbounds=seq(3,9,len=15),nperms=5)
print(km.perm)
plot(km.perm)
# run sparse k-means[运行稀疏的k-means]
km.out <- KMeansSparseCluster(x,K=2,wbounds=km.perm$bestw)
print(km.out)
plot(km.out)
# run sparse k-means for a range of tuning parameter values[运行装置,用于整定参数值的范围内的稀疏的k-]
km.out <- KMeansSparseCluster(x,K=2,wbounds=2:7)
print(km.out)
plot(km.out)
# Run sparse k-means starting from a particular set of cluster centers[运行稀疏的k-means聚类中心从一组特定]
#in the k-means algorithm.[在k-means算法。]
km.out <- KMeansSparseCluster(x,wbounds=2:7,centers=x[c(1,3,5),])
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|