【发布时间】:2019-11-10 10:41:37
【问题描述】:
我有一个标准化的基因表达数据,我想为其找到最佳聚类数。准备好数据后使用mclust包,
我正在使用以下方法对数据进行排名。
ranked.exprs <- probe_ranking(input=exp_file,
probe_number=2000,
probe_num_selection="Fixed_Probe_Num",
data.exp=genes,
method="SD_Rank")
使用
#Calculate number of clusters
cluster_num <- number_clusters(data.exp=genes, Fixed=NULL,
gap_statistic=TRUE)
# I get 8
#checking silhouette values for kmeans
resukm <-fviz_nbclust(ranked.exprs, FUNcluster = kmeans, method = c("silhouette"), diss = NULL, k.max = 10, nboot = 10,
verbose = interactive(), barfill = "steelblue", barcolor = "steelblue",
linecolor = "steelblue", print.summary = TRUE)
#results to 2 clusters
#running the gap statistic using hierarchical clustering
gap_stat <- clusGap(genes, FUN=hcut, K.max = 10, B = 50)
#results to 2 clusters
#checking silhouette values for hierarchical clustering
resuhie <-fviz_nbclust(genes, FUNcluster = hcut, method = c("silhouette"), diss = NULL, k.max = 10, nboot = 10,
verbose = interactive(), barfill = "steelblue", barcolor = "steelblue",
linecolor = "steelblue", print.summary = TRUE)
#results to 2 clusters
得到两个不同的数字 8 和 2 的原因是什么?我的数据也包含缺失值。
【问题讨论】:
标签: r cluster-analysis