som神经网络聚类简单例子_基因表达聚类分析之初探SOM - 自组织特征图

本文介绍了SOM(自组织特征图)神经网络聚类的基本理论和实战步骤,包括数据预处理、模型训练、结果可视化和评估。通过R中的kohonen包进行基因表达数据的SOM分析,展示了训练过程、节点计数、质量评估、边界点分析等关键步骤,最后进行了进一步的聚类和结果解读。适合于理解SOM聚类方法及其在生物信息学中的应用。
摘要由CSDN通过智能技术生成

之前的培训有老师提出要做SOM分析,最后卡在code plot只能出segment plot却出不来line plot。查了下,没看到解决方案。今天看了下源码,设置了一个参数,得到趋势图。也顺便学习了SOM分析的整个过程,整理下来,以备以后用到。

更多聚类相关见:

基因共表达聚类分析和可视化

聚类分析factoextra

获取pheatmap聚类后和标准化后的结果

WGCNA分析,简单全面的最新教程

一文学会网络分析——Co-occurrence网络图在R中的实现

SOM分析基本理论

SOM (Self-Organizing Feature Map,自组织特征图)是基于神经网络方式的数据矩阵和可视化方式。与其它类型的中心点聚类算法如K-means等相似,SOM也是找到一组中心点 (又称为codebook vector),然后根据最相似原则把数据集的每个对象映射到对应的中心点。在神经网络术语中,每个神经元对应于一个中心点。

与K-means类似,数据集中的每个对象每次处理一个,判断最近的中心点,然后更新中心点。与K-means不同的是,SOM中中心点之间存在拓扑形状顺序,在更新一个中心点的同时,邻近的中心点也会随着更新,直到达到设定的阈值或中心点不再有显著变化。最终获得一系列的中心点 (codes)隐式地定义多个簇,与这个中心点最近的对象归为同一个簇。

SOM强调簇中心点之间的邻近关系,相邻的簇之间相关性更强,更有利于解释结果,常用于可视化网络数据或基因表达数据。

Even though SOM is similar to K-means, there is a fundamental difference. Centroids used in SOM have a predetermined topographic ordering relationship. During the training process, SOM uses each data point to update the closest centroid and centroids that are nearby in the topographic ordering. In this way, SOM produces an ordered set of centroids for any given data set. In other words, the centroids that are close to each other in the SOM grid are more closely related to each other than to the centroids that are farther away. Because of this constraint, the centroids of a two-dimensional SOM can be viewed as lying on a two-dimensional surface that tries to fit the n-dimensional data as well as possible. The SOM centroids can also be thought of as the result of a nonlinear regression with respect to the data points. At a high level, clustering using the SOM technique consists of the steps described in Algorithm below:

  1. 1: Initialize the centroids.
  2. 2: repeat
  3. 3: Select the next object.
  4. 4: Determine the closest centroid to the object.
  5. 5: Update this centroid and the centroids that are close, i.e., in a specified neighborhood.
  6. 6: until The centroids don't change much or a threshold is exceeded.
  7. 7: Assign each object to its closest centroid and return the centroids and clusters.

SOM分析实战

下面是R中用kohonen包进行基因表达数据的SOM分析。

加载或安装包

  1. ### LOAD LIBRARIES - install with:
  2. #install.packages(c("kohonen")
  3. library(kohonen)

读入数据并进行标准化

  1. data <- read.table("ehbio_trans.Count_matrix.xls", row.names=1, header=T, sep="t")
  2. # now train the SOM using the Kohonen method
  3. # 标准化数据
  4. data_train_matrix <- as.matrix(t(scale(t(data))))
  5. names(data_train_matrix) <- names(data)
  6. head(data_train_matrix)
  1. untrt_N61311 untrt_N052611 untrt_N080611 untrt_N06
  • 2
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值