Civilized_Spectral_Clustering(SamSPECTRAL)
Civilized_Spectral_Clustering()所属R语言包:SamSPECTRAL
Runs the spectral clustering algorithm on the sample points.
运行样本点的谱聚类算法。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The representatives of communities are considered as the vertices of a graph. Assuming the edges have been weighted according to the equivalent conductance between them, this function runs the classic spectral clustering on the graph.
社区的代表,被视为一个图的顶点。假设加权边缘已根据它们之间的等效电导,这个功能运行经典的谱聚类图。
用法----------Usage----------
Civilized_Spectral_Clustering(full, maximum.number.of.clusters, society, conductance,iterations=200, number.of.clusters=NA,
eigenvalues.num =NA, talk=TRUE,stabilizer=1000)
参数----------Arguments----------
参数:full
The matrix containing the coordinates of all data points.
矩阵包含的所有数据点的坐标。
参数:maximum.number.of.clusters
This parameter is used for fitting the regression line.
此参数用于拟合回归直线。
参数:number.of.clusters
The default value is NA which leads to computating the number of spectral clusters automatically, otherwise this number will determine the number of spectral clusters.
默认值是NA,从而导致光谱聚类computating自动,否则这个数字将决定光谱聚类。
参数:society
The list of communities.
社区名单。
参数:conductance
A matrix in which each entry is the conductance between two communities.
A矩阵中的每个条目是两族之间的电导。
参数:iterations
Number of iterations for the k-means algorithm used by the spectral procedure. 200 is an appropriate value.
由光谱的过程中所使用的k-means算法的迭代数目。 200是一个适当的值。
参数:talk
A boolean flag with default value TRUE. Setting it to FALSE will keep running the procedure quite with no messages.
一个布尔标志使用默认值true。设置为false,将继续运行程序相当没有消息。
参数:eigenvalues.num
An integer with default value NA which prevents ploting the curve of eigenvalues. Otherwise, they will be ploted upto this number.
与防止作图的曲线特征值的默认值的NA整数。否则,他们将ploted高达这个数字。
参数:stabilizer
The larger this integer is, the final results will be more stable because the underlying kmeans will restart many more times.
这个整数是较大的,最后的结果会更加稳定,因为底层的KMEANS将重新启动很多倍。
值----------Value----------
参数:labels.for_num.of.clusters
The k'th element of this list is a vector containing the labels as result of clustering to k parts.
此列表的第k个元素是一个向量,作为结果的聚类的k部分标签。
参数:number.of.clusters
A list containing the desired cluster numbers.
一个列表,其中包含所需的聚类。
参数:eigen.space
The eigen vectors and eigen values of the normalized adjacency matrix computed for spectral clustering.
谱聚类归邻接矩阵的特征向量和特征值计算。
作者(S)----------Author(s)----------
Parisa Shooshtari and Habil Zare
参考文献----------References----------
<h3>See Also</h3> <code>SamSPECTRAL</code>
举例----------Examples----------
## Not run: [#无法运行:]
library(SamSPECTRAL)
# Reading data file which has been transformed using log transform[读取数据文件已使用log变换转化]
data(small_data)
full <- small
# Parameters:[参数:]
m <- 3000; ns <- 200; sl <- 3; cwt <-1; precision <- 6; mnc <-30
# Sample the data and build the communities[样本数据,并建立社区]
society <- Building_Communities(full=full,m=m, space.length=sl, community.weakness.threshold=cwt)
# Compute conductance between communities[计算社区之间的电导]
conductance <- Conductance_Calculation(full=full, normal.sigma=ns, space.length=sl, society=society, precision=precision)
# Use spectral clustering to cluster the data[使用聚类数据谱聚类]
# First example:[第一个例子:]
clust_result <- Civilized_Spectral_Clustering(full=full, maximum.number.of.clusters=mnc, society=society, conductance=conductance)
number.of.clusters <- clust_result@number.of.clusters
labels.for_num.of.clusters <- clust_result@labels.for_num.of.clusters
L <- labels.for_num.of.clusters[[number.of.clusters]]
# plot(full, pch='.', col= L)[图(完整,PCH =。,COL =)]
# Second example:[第二个例子:]
number.of.clusters <- c(35,20)
# This is faster than runnig Civilized_Spectral_Clustering() twice because the eigen space is not needed to be computed again. [这是速度比两次runnig Civilized_Spectral_Clustering(),因为不需要重新计算特征空间。]
clust_result.not.automatic <-
Civilized_Spectral_Clustering(full=full, society=society, conductance=conductance, number.of.clusters =number.of.clusters)
labels.for_num.of.clusters <- clust_result.not.automatic@labels.for_num.of.clusters
L35 <- labels.for_num.of.clusters[[35]]
L20 <- labels.for_num.of.clusters[[20]]
# plot(full, pch='.', col= L35)[图(完整,PCH =。,COL = L35)]
## End(Not run)[#结束(不运行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|