【Scikit-Learn 中文文档】双聚类 - 无监督学习 - 用户指南 | ApacheCN
2017-12-03 20:39
288 查看
中文文档: http://sklearn.apachecn.org/cn/stable/modules/biclustering.html
英文文档: http://sklearn.apachecn.org/en/stable/modules/biclustering.html
官方文档: http://scikit-learn.org/stable/
GitHub: https://github.com/apachecn/scikit-learn-doc-zh(觉得不错麻烦给个
Star,我们一直在努力)
贡献者: https://github.com/apachecn/scikit-learn-doc-zh#贡献者
关于我们: http://www.apachecn.org/organization/209.html
Biclustering 可以使用
Biclustering 算法对数据矩阵的行列同时进行聚类。 同时对行列进行聚类称之为 biclusters。 每一次聚类都会通过原始数据矩阵的一些属性确定一个子矩阵。
例如, 一个矩阵
>>>
为了可视化, 给定一个 bicluster 聚类,数据矩阵的行列可以重新分配,使得 bi-cluster 是连续的。
算法在如何定义 bicluster 方面有一些不同,常见类型包括:
不变的 values , 不变的 rows, 或者不变的 columns。
异常高的或者低的值。
低方差的子矩阵。
相关的 rows 或者 columns。
算法在分配给 bicluster 行列的方式不同, 会导致不同的 bicluster 结构。 当行和列分成分区时,会发生对角线或者棋盘结构。
如果每一行和每一列同属于一种 bicluster ,就重新排列数据矩阵的行和列,会使得 bicluster 呈现对角线。 下面是一个例子,此结构的biclusters 具有比其他行列更高的平均值:
![](http://sklearn.apachecn.org/cn/stable/_images/sphx_glr_plot_spectral_coclustering_0031.png)
在棋盘结构的例子中, 每一行属于所有的列类别, 每一列属于所有的行类别。 下面是一个例子,每个 bicluster 中的值差异较小:
![](http://sklearn.apachecn.org/cn/stable/_images/sphx_glr_plot_spectral_biclustering_0031.png)
在拟合模型之后, 可以在
cluster membership 。
同样的,
一些模块也有
这些模块对行列进行分区, 例如对角线或者棋盘 bicluster 结构。
Note
Biclustering 在不同的领域有很多其他名称,包括 co-clustering, two-mode clustering, two-way clustering, block clustering, coupled two-way clustering 等.有一些算法的名称,比如 Spectral Co-Clustering algorithm, 反应了这些备用名称。
bicluster 的值比相应的其他行和列更高。
每一个行和列都只属于一个 bicluster, 所以重新分配行和列,使得分区连续显示对角线上的 high value:
Note
算法将输入的数据矩阵看做成二分图:该矩阵的行和列对应于两组顶点,每个条目对应于行和列之间的边,该算法近似的进行归一化,对图进行切割,找到更重的子图。
找到最优归一化剪切的近似解,可以通过图形的 Laplacian 的广义特征值分解。 通常这意味着直接使用 Laplacian 矩阵. 如果原始数据矩阵
![](http://sklearn.apachecn.org/cn/stable/_images/math/0043fe6507e9b1d112e07a2801e24927e267dd50.png)
有形状
![](http://sklearn.apachecn.org/cn/stable/_images/math/a4aa98eb66dde627d2ff991463b1548b747fc221.png)
,
则对应的 bipartite 图的 Laplacian 矩阵具有形状
![](http://sklearn.apachecn.org/cn/stable/_images/math/db0c11cdac309143cbe7ed42ce3601c670a38ab4.png)
。
但是, 在这种情况直接使用
![](http://sklearn.apachecn.org/cn/stable/_images/math/0043fe6507e9b1d112e07a2801e24927e267dd50.png)
, 因为它更小,更有作用。
输入矩阵
![](http://sklearn.apachecn.org/cn/stable/_images/math/0043fe6507e9b1d112e07a2801e24927e267dd50.png)
被预处理如下:
![](http://sklearn.apachecn.org/cn/stable/_images/math/a7c8a7222f104393fe9778e796d8c429b0c22c32.png)
![](http://sklearn.apachecn.org/cn/stable/_images/math/a00254b18ffa992f0ef19f6e6e095b83c8f85e94.png)
是
![](http://sklearn.apachecn.org/cn/stable/_images/math/df0deb143e5ac127f00bd248ee8001ecae572adc.png)
对角线矩阵,和
![](http://sklearn.apachecn.org/cn/stable/_images/math/0cff13082b1c310f63732c327e38e0a5bab69dc6.png)
相同,
![](http://sklearn.apachecn.org/cn/stable/_images/math/afce44aa7c55836ca9345404c22fc7b599d2ed84.png)
是
![](http://sklearn.apachecn.org/cn/stable/_images/math/6b21e0b0899a0d2879d3b8019087fa630bab4ea2.png)
的对角吸纳矩阵,等同于
![](http://sklearn.apachecn.org/cn/stable/_images/math/2a9f6f13d20d5cbad5cd1562d900ff3dad9617b5.png)
。
奇异值分解,
![](http://sklearn.apachecn.org/cn/stable/_images/math/9307ab783e3fbb06db6a9c<br/>10fb1<br/>92d9d8c72e273cdaf8.png)
, 提供了
![](http://sklearn.apachecn.org/cn/stable/_images/math/0043fe6507e9b1d112e07a2801e24927e267dd50.png)
行列的分区.
左边的奇异值向量给予行分区,右边的奇异值向量给予列分区。
![](http://sklearn.apachecn.org/cn/stable/_images/math/84deb2b5c91775b5b9760f47a4284d4b40093461.png)
奇异值向量从第二个开始,
提供所需的分区信息。 这些用于形成矩阵 :Z:
![](http://sklearn.apachecn.org/cn/stable/_images/math/136c762c8efedf19486f6e7e8acf2e4572bc3398.png)
![](http://sklearn.apachecn.org/cn/stable/_images/math/169c982b5e649cd1bd6445df5583affe427ea269.png)
的列是
![](http://sklearn.apachecn.org/cn/stable/_images/math/35237c2da718fbae8968e315e014a0666b759c25.png)
,
和
![](http://sklearn.apachecn.org/cn/stable/_images/math/fae0e7a73748991e5540d874416000583f64f58e.png)
相似 。
然后
![](http://sklearn.apachecn.org/cn/stable/_images/math/bcb2457ac9d8995a4f34d57cadac7ecbbe58f3bd.png)
的 rows 通过使用 k-means 进行聚类.
剩下的
例子:
A
demo of the Spectral Co-Clustering algorithm: 如何用 bicluster 数据矩阵并应用。
Biclustering
documents with the Spectral Co-clustering algorithm:一个在 20 个新闻组数据集中发现 biclusters 的例子
参考文献:
Dhillon, Inderjit S, 2001. Co-clustering
documents and words using bipartite spectral graph partitioning.
具有这种结构的矩阵的行列 可能被分区,使得在笛卡尔积中的 大部分 biclusters 的 row clusters 和 column cluster 是近似恒定的。
例如,如果有两个row 分区和三个列分区,每一行属于三个 bicluster ,每一列属于两个 bicluster。
这个算法划分矩阵的行和列,以至于提供一个相应的块状不变的棋盘矩阵,近似于原始矩阵。
输入矩阵
![](http://sklearn.apachecn.org/cn/stable/_images/math/0043fe6507e9b1d112e07a2801e24927e267dd50.png)
先归一化,使得棋盘模式更明显。有三种方法:
独立的行和列归一化, as in Spectral Co-Clustering. 这个方法使得行和一个常数相加,列和变量相加。
Bistochastization: 重复行和列归一化直到收敛。该方法使得行和列都相加
相同的常数。
Log 归一化: 计算数据矩阵的对数
![](http://sklearn.apachecn.org/cn/stable/_images/math/f2c2a8ea3b216bb8693ecb2007fdf40bbec05eb0.png)
.
列就是
![](http://sklearn.apachecn.org/cn/stable/_images/math/13ad8d09b9addbf06f32031a30e00d5446149ed6.png)
, 行就是
![](http://sklearn.apachecn.org/cn/stable/_images/math/d22f8be276504dd5ab9f54042b3bf37fa66971e7.png)
,
总体上来看
![](http://sklearn.apachecn.org/cn/stable/_images/math/25937f902e4dba82f6d70067474c5e69bbeb3711.png)
of
![](http://sklearn.apachecn.org/cn/stable/_images/math/ae2b750f71e1fc0daaa3de9a85d42794d7cd1326.png)
被计算的.
最后矩阵通过下面的公式计算
![](http://sklearn.apachecn.org/cn/stable/_images/math/1a59f73d14f3c7dbf1f1de48de775800f90d88e5.png)
归一化后,首先少量的奇异值向量被计算,只是在 Spectral Co-Clustering 算法中。
如果使用 log 归一化,则所有的奇异向量都是有意义的。但是, 如果是独立的归一化或双曲线化 被使用,第一个奇异矢量,
![](http://sklearn.apachecn.org/cn/stable/_images/math/cf40a917043ed52a5b1c5bc60daf0128a1b47f64.png)
和
![](http://sklearn.apachecn.org/cn/stable/_images/math/8fecd40ca8eb7e61734850b21956deba20be3066.png)
。
会被丢弃。 从现在开始, “first” 奇异值向量与
![](http://sklearn.apachecn.org/cn/stable/_images/math/abc59fbd07c450fde332de0de33e768b132143d3.png)
和
![](http://sklearn.apachecn.org/cn/stable/_images/math/fb6d1f67e52083c030936b2f244850d5193d9b26.png)
相关,除了日志归一化的情况。
给定这些奇异值向量, 将他们排序,通过分段常数向量保证最佳近似。 使用一维 k-means 找到每个向量的近似值 并使用欧几里得距离得分。 Some subset of 最好的左右奇异值向量的子集被选择。 下一步, 数据预计到这个最佳子集的奇异向量和聚类。
例如,如果
![](http://sklearn.apachecn.org/cn/stable/_images/math/27d463da4622be5b3ef1d4176ced7d7a323c6425.png)
奇异值向量被计算,最好按照描述找到
![](http://sklearn.apachecn.org/cn/stable/_images/math/620a3ce6403ec82f1347af9985bc03f7a9382f4a.png)
,
其中
![](http://sklearn.apachecn.org/cn/stable/_images/math/1bc98d57cbfe3d7dc1419afe1527ea0771ce74bd.png)
。
![](http://sklearn.apachecn.org/cn/stable/_images/math/169c982b5e649cd1bd6445df5583affe427ea269.png)
列为,the
![](http://sklearn.apachecn.org/cn/stable/_images/math/620a3ce6403ec82f1347af9985bc03f7a9382f4a.png)
最佳左奇异向量的矩阵,
并且
![](http://sklearn.apachecn.org/cn/stable/_images/math/fae0e7a73748991e5540d874416000583f64f58e.png)
对于右边是类似的. 要划分行, 将
![](http://sklearn.apachecn.org/cn/stable/_images/math/0043fe6507e9b1d112e07a2801e24927e267dd50.png)
的
投影到
![](http://sklearn.apachecn.org/cn/stable/_images/math/620a3ce6403ec82f1347af9985bc03f7a9382f4a.png)
维空间:
![](http://sklearn.apachecn.org/cn/stable/_images/math/b6f0db892a2f7ed877b3a83674ee1932a16340cb.png)
。
![](http://sklearn.apachecn.org/cn/stable/_images/math/edba97b4c0d864d26e92ea7ea73767fa38eef3f7.png)
行
![](http://sklearn.apachecn.org/cn/stable/_images/math/72ed3a9ec9bd6e7c124620e1aac526277847d074.png)
矩阵的行作为采样和使用
k-means 的聚类处理产生行标签。 类似地,将列投影到
![](http://sklearn.apachecn.org/cn/stable/_images/math/a3091a5335fd5b9fc73ede24de6b277d853161c5.png)
,并且对
![](http://sklearn.apachecn.org/cn/stable/_images/math/5e9d7e95b083ffb7b8cb72b0a16199c4ef63cef3.png)
矩阵进行聚类得到列标签。
示例:
A
demo of the Spectral Biclustering algorithm: 一个简单的例子 显示如何生成棋盘矩阵和 bicluster
.
参考文献:
Kluger, Yuval, et. al., 2003. Spectral biclustering
of microarray data: coclustering genes and conditions.
有两种评估双组分结果的方法:内部和外部。 诸如群集稳定性等内部措施只依赖于数据和结果本身。 目前在scikit-learn中没有内部的二集群措施。外部措施是指外部信息来源,例如真正的解决方案。 当使用真实数据时,真正的解决方案通常是未知的,但是,由于真正的解决方案是已知的,因此人造数据的双重分析可能对于评估算法非常有用。
为了将一组已发现的双组分与一组真正的双组分进行比较, 需要两个相似性度量:单个双色团体的相似性度量,以及将这些个体相似度结合到总分中的方法。
为了比较单个双核,已经采用了几种措施。现在,只有Jaccard索引被实现:
![](http://sklearn.apachecn.org/cn/stable/_images/math/380ca2d20a08e36aecb173790e00d05b274603ce.png)
![](http://sklearn.apachecn.org/cn/stable/_images/math/0043fe6507e9b1d112e07a2801e24927e267dd50.png)
和
![](http://sklearn.apachecn.org/cn/stable/_images/math/9805f44feec6f81d376d09e88b8236635edbb3c8.png)
是
biclusters,
![](http://sklearn.apachecn.org/cn/stable/_images/math/2224fea2d639f17ad5a333cea91e3e2e61f6d852.png)
是交叉点的元素的数量。
Jaccard 索引 达到最小值0,当 biclusters 不重叠的时候,并且当他们相同干的时候,最大值为1。
有些方法已经开发出来,用来比较两个 biclusters 的数据集。 从现在开始 之后
et. al., 2010) 是可以用:
使用 Jaccard 索引或类似措施,计算 biclusters 的 bicluster 相似性。
以一对一的方式将 bicluster 分从一组分配给另一组,以最大化其相似性的总和。该步骤使用匈牙利算法执行。
相似性的最终总和除以较大集合的大小。
最小共识得分为0,发生在所有 biclusters 完全不相似时。当两组 biclusters 相同时,最大分数为1。
参考文献:
Hochreiter, Bodenhofer, et. al., 2010. FABIA: factor
analysis for bicluster acquisition.
中文文档: http://sklearn.apachecn.org/cn/stable/modules/biclustering.html
英文文档: http://sklearn.apachecn.org/en/stable/modules/biclustering.html
官方文档: http://scikit-learn.org/stable/
GitHub: https://github.com/apachecn/scikit-learn-doc-zh(觉得不错麻烦给个
Star,我们一直在努力)
贡献者: https://github.com/apachecn/scikit-learn-doc-zh#贡献者
关于我们: http://www.apachecn.org/organization/209.html
有兴趣的们也可以和我们一起来维护,持续更新中 。。。
机器学习交流群: 629470233
英文文档: http://sklearn.apachecn.org/en/stable/modules/biclustering.html
官方文档: http://scikit-learn.org/stable/
GitHub: https://github.com/apachecn/scikit-learn-doc-zh(觉得不错麻烦给个
Star,我们一直在努力)
贡献者: https://github.com/apachecn/scikit-learn-doc-zh#贡献者
关于我们: http://www.apachecn.org/organization/209.html
2.4. 双聚类
Biclustering 可以使用 sklearn.cluster.bicluster模块。
Biclustering 算法对数据矩阵的行列同时进行聚类。 同时对行列进行聚类称之为 biclusters。 每一次聚类都会通过原始数据矩阵的一些属性确定一个子矩阵。
例如, 一个矩阵
(10, 10), 一个 bicluster 聚类,有三列二行,就是一个子矩阵
(3, 2)
>>>
>>> import numpy as np >>> data = np.arange(100).reshape(10, 10) >>> rows = np.array([0, 2, 3])[:, np.newaxis] >>> columns = np.array([1, 2]) >>> data[rows, columns] array([[ 1, 2], [21, 22], [31, 32]])
为了可视化, 给定一个 bicluster 聚类,数据矩阵的行列可以重新分配,使得 bi-cluster 是连续的。
算法在如何定义 bicluster 方面有一些不同,常见类型包括:
不变的 values , 不变的 rows, 或者不变的 columns。
异常高的或者低的值。
低方差的子矩阵。
相关的 rows 或者 columns。
算法在分配给 bicluster 行列的方式不同, 会导致不同的 bicluster 结构。 当行和列分成分区时,会发生对角线或者棋盘结构。
如果每一行和每一列同属于一种 bicluster ,就重新排列数据矩阵的行和列,会使得 bicluster 呈现对角线。 下面是一个例子,此结构的biclusters 具有比其他行列更高的平均值:
![](http://sklearn.apachecn.org/cn/stable/_images/sphx_glr_plot_spectral_coclustering_0031.png)
在棋盘结构的例子中, 每一行属于所有的列类别, 每一列属于所有的行类别。 下面是一个例子,每个 bicluster 中的值差异较小:
![](http://sklearn.apachecn.org/cn/stable/_images/sphx_glr_plot_spectral_biclustering_0031.png)
在拟合模型之后, 可以在
rows_和
columns_属性中找到行列
cluster membership 。
rows_[i]是一个二进制的向量, 就是属于 bicluster
i的一行。
同样的,
columns_[i]就表示属于 bicluster
i的列。
一些模块也有
row_labels_何
column_labels_属性。
这些模块对行列进行分区, 例如对角线或者棋盘 bicluster 结构。
Note
Biclustering 在不同的领域有很多其他名称,包括 co-clustering, two-mode clustering, two-way clustering, block clustering, coupled two-way clustering 等.有一些算法的名称,比如 Spectral Co-Clustering algorithm, 反应了这些备用名称。
2.4.1. Spectral Co-Clustering
SpectralCoclustering算法找到的
bicluster 的值比相应的其他行和列更高。
每一个行和列都只属于一个 bicluster, 所以重新分配行和列,使得分区连续显示对角线上的 high value:
Note
算法将输入的数据矩阵看做成二分图:该矩阵的行和列对应于两组顶点,每个条目对应于行和列之间的边,该算法近似的进行归一化,对图进行切割,找到更重的子图。
2.4.1.1. 数学公式
找到最优归一化剪切的近似解,可以通过图形的 Laplacian 的广义特征值分解。 通常这意味着直接使用 Laplacian 矩阵. 如果原始数据矩阵 ![](http://sklearn.apachecn.org/cn/stable/_images/math/0043fe6507e9b1d112e07a2801e24927e267dd50.png)
有形状
![](http://sklearn.apachecn.org/cn/stable/_images/math/a4aa98eb66dde627d2ff991463b1548b747fc221.png)
,
则对应的 bipartite 图的 Laplacian 矩阵具有形状
![](http://sklearn.apachecn.org/cn/stable/_images/math/db0c11cdac309143cbe7ed42ce3601c670a38ab4.png)
。
但是, 在这种情况直接使用
![](http://sklearn.apachecn.org/cn/stable/_images/math/0043fe6507e9b1d112e07a2801e24927e267dd50.png)
, 因为它更小,更有作用。
输入矩阵
![](http://sklearn.apachecn.org/cn/stable/_images/math/0043fe6507e9b1d112e07a2801e24927e267dd50.png)
被预处理如下:
![](http://sklearn.apachecn.org/cn/stable/_images/math/a7c8a7222f104393fe9778e796d8c429b0c22c32.png)
![](http://sklearn.apachecn.org/cn/stable/_images/math/a00254b18ffa992f0ef19f6e6e095b83c8f85e94.png)
是
![](http://sklearn.apachecn.org/cn/stable/_images/math/df0deb143e5ac127f00bd248ee8001ecae572adc.png)
对角线矩阵,和
![](http://sklearn.apachecn.org/cn/stable/_images/math/0cff13082b1c310f63732c327e38e0a5bab69dc6.png)
相同,
![](http://sklearn.apachecn.org/cn/stable/_images/math/afce44aa7c55836ca9345404c22fc7b599d2ed84.png)
是
![](http://sklearn.apachecn.org/cn/stable/_images/math/6b21e0b0899a0d2879d3b8019087fa630bab4ea2.png)
的对角吸纳矩阵,等同于
![](http://sklearn.apachecn.org/cn/stable/_images/math/2a9f6f13d20d5cbad5cd1562d900ff3dad9617b5.png)
。
奇异值分解,
![](http://sklearn.apachecn.org/cn/stable/_images/math/9307ab783e3fbb06db6a9c<br/>10fb1<br/>92d9d8c72e273cdaf8.png)
, 提供了
![](http://sklearn.apachecn.org/cn/stable/_images/math/0043fe6507e9b1d112e07a2801e24927e267dd50.png)
行列的分区.
左边的奇异值向量给予行分区,右边的奇异值向量给予列分区。
![](http://sklearn.apachecn.org/cn/stable/_images/math/84deb2b5c91775b5b9760f47a4284d4b40093461.png)
奇异值向量从第二个开始,
提供所需的分区信息。 这些用于形成矩阵 :Z:
![](http://sklearn.apachecn.org/cn/stable/_images/math/136c762c8efedf19486f6e7e8acf2e4572bc3398.png)
![](http://sklearn.apachecn.org/cn/stable/_images/math/169c982b5e649cd1bd6445df5583affe427ea269.png)
的列是
![](http://sklearn.apachecn.org/cn/stable/_images/math/35237c2da718fbae8968e315e014a0666b759c25.png)
,
和
![](http://sklearn.apachecn.org/cn/stable/_images/math/fae0e7a73748991e5540d874416000583f64f58e.png)
相似 。
然后
![](http://sklearn.apachecn.org/cn/stable/_images/math/bcb2457ac9d8995a4f34d57cadac7ecbbe58f3bd.png)
的 rows 通过使用 k-means 进行聚类.
n_rows标签提供行分区,
剩下的
n_columns标签 提供 列分区。
例子:
A
demo of the Spectral Co-Clustering algorithm: 如何用 bicluster 数据矩阵并应用。
Biclustering
documents with the Spectral Co-clustering algorithm:一个在 20 个新闻组数据集中发现 biclusters 的例子
参考文献:
Dhillon, Inderjit S, 2001. Co-clustering
documents and words using bipartite spectral graph partitioning.
2.4.2. Spectral Biclustering
SpectralBiclustering算法假设输入的数据矩阵具有隐藏的棋盘结构。
具有这种结构的矩阵的行列 可能被分区,使得在笛卡尔积中的 大部分 biclusters 的 row clusters 和 column cluster 是近似恒定的。
例如,如果有两个row 分区和三个列分区,每一行属于三个 bicluster ,每一列属于两个 bicluster。
这个算法划分矩阵的行和列,以至于提供一个相应的块状不变的棋盘矩阵,近似于原始矩阵。
2.4.2.1. 数学表示
输入矩阵 ![](http://sklearn.apachecn.org/cn/stable/_images/math/0043fe6507e9b1d112e07a2801e24927e267dd50.png)
先归一化,使得棋盘模式更明显。有三种方法:
独立的行和列归一化, as in Spectral Co-Clustering. 这个方法使得行和一个常数相加,列和变量相加。
Bistochastization: 重复行和列归一化直到收敛。该方法使得行和列都相加
相同的常数。
Log 归一化: 计算数据矩阵的对数
![](http://sklearn.apachecn.org/cn/stable/_images/math/f2c2a8ea3b216bb8693ecb2007fdf40bbec05eb0.png)
.
列就是
![](http://sklearn.apachecn.org/cn/stable/_images/math/13ad8d09b9addbf06f32031a30e00d5446149ed6.png)
, 行就是
![](http://sklearn.apachecn.org/cn/stable/_images/math/d22f8be276504dd5ab9f54042b3bf37fa66971e7.png)
,
总体上来看
![](http://sklearn.apachecn.org/cn/stable/_images/math/25937f902e4dba82f6d70067474c5e69bbeb3711.png)
of
![](http://sklearn.apachecn.org/cn/stable/_images/math/ae2b750f71e1fc0daaa3de9a85d42794d7cd1326.png)
被计算的.
最后矩阵通过下面的公式计算
![](http://sklearn.apachecn.org/cn/stable/_images/math/1a59f73d14f3c7dbf1f1de48de775800f90d88e5.png)
归一化后,首先少量的奇异值向量被计算,只是在 Spectral Co-Clustering 算法中。
如果使用 log 归一化,则所有的奇异向量都是有意义的。但是, 如果是独立的归一化或双曲线化 被使用,第一个奇异矢量,
![](http://sklearn.apachecn.org/cn/stable/_images/math/cf40a917043ed52a5b1c5bc60daf0128a1b47f64.png)
和
![](http://sklearn.apachecn.org/cn/stable/_images/math/8fecd40ca8eb7e61734850b21956deba20be3066.png)
。
会被丢弃。 从现在开始, “first” 奇异值向量与
![](http://sklearn.apachecn.org/cn/stable/_images/math/abc59fbd07c450fde332de0de33e768b132143d3.png)
和
![](http://sklearn.apachecn.org/cn/stable/_images/math/fb6d1f67e52083c030936b2f244850d5193d9b26.png)
相关,除了日志归一化的情况。
给定这些奇异值向量, 将他们排序,通过分段常数向量保证最佳近似。 使用一维 k-means 找到每个向量的近似值 并使用欧几里得距离得分。 Some subset of 最好的左右奇异值向量的子集被选择。 下一步, 数据预计到这个最佳子集的奇异向量和聚类。
例如,如果
![](http://sklearn.apachecn.org/cn/stable/_images/math/27d463da4622be5b3ef1d4176ced7d7a323c6425.png)
奇异值向量被计算,最好按照描述找到
![](http://sklearn.apachecn.org/cn/stable/_images/math/620a3ce6403ec82f1347af9985bc03f7a9382f4a.png)
,
其中
![](http://sklearn.apachecn.org/cn/stable/_images/math/1bc98d57cbfe3d7dc1419afe1527ea0771ce74bd.png)
。
![](http://sklearn.apachecn.org/cn/stable/_images/math/169c982b5e649cd1bd6445df5583affe427ea269.png)
列为,the
![](http://sklearn.apachecn.org/cn/stable/_images/math/620a3ce6403ec82f1347af9985bc03f7a9382f4a.png)
最佳左奇异向量的矩阵,
并且
![](http://sklearn.apachecn.org/cn/stable/_images/math/fae0e7a73748991e5540d874416000583f64f58e.png)
对于右边是类似的. 要划分行, 将
![](http://sklearn.apachecn.org/cn/stable/_images/math/0043fe6507e9b1d112e07a2801e24927e267dd50.png)
的
投影到
![](http://sklearn.apachecn.org/cn/stable/_images/math/620a3ce6403ec82f1347af9985bc03f7a9382f4a.png)
维空间:
![](http://sklearn.apachecn.org/cn/stable/_images/math/b6f0db892a2f7ed877b3a83674ee1932a16340cb.png)
。
![](http://sklearn.apachecn.org/cn/stable/_images/math/edba97b4c0d864d26e92ea7ea73767fa38eef3f7.png)
行
![](http://sklearn.apachecn.org/cn/stable/_images/math/72ed3a9ec9bd6e7c124620e1aac526277847d074.png)
矩阵的行作为采样和使用
k-means 的聚类处理产生行标签。 类似地,将列投影到
![](http://sklearn.apachecn.org/cn/stable/_images/math/a3091a5335fd5b9fc73ede24de6b277d853161c5.png)
,并且对
![](http://sklearn.apachecn.org/cn/stable/_images/math/5e9d7e95b083ffb7b8cb72b0a16199c4ef63cef3.png)
矩阵进行聚类得到列标签。
示例:
A
demo of the Spectral Biclustering algorithm: 一个简单的例子 显示如何生成棋盘矩阵和 bicluster
.
参考文献:
Kluger, Yuval, et. al., 2003. Spectral biclustering
of microarray data: coclustering genes and conditions.
2.4.3. Biclustering 评测
有两种评估双组分结果的方法:内部和外部。 诸如群集稳定性等内部措施只依赖于数据和结果本身。 目前在scikit-learn中没有内部的二集群措施。外部措施是指外部信息来源,例如真正的解决方案。 当使用真实数据时,真正的解决方案通常是未知的,但是,由于真正的解决方案是已知的,因此人造数据的双重分析可能对于评估算法非常有用。为了将一组已发现的双组分与一组真正的双组分进行比较, 需要两个相似性度量:单个双色团体的相似性度量,以及将这些个体相似度结合到总分中的方法。
为了比较单个双核,已经采用了几种措施。现在,只有Jaccard索引被实现:
![](http://sklearn.apachecn.org/cn/stable/_images/math/380ca2d20a08e36aecb173790e00d05b274603ce.png)
![](http://sklearn.apachecn.org/cn/stable/_images/math/0043fe6507e9b1d112e07a2801e24927e267dd50.png)
和
![](http://sklearn.apachecn.org/cn/stable/_images/math/9805f44feec6f81d376d09e88b8236635edbb3c8.png)
是
biclusters,
![](http://sklearn.apachecn.org/cn/stable/_images/math/2224fea2d639f17ad5a333cea91e3e2e61f6d852.png)
是交叉点的元素的数量。
Jaccard 索引 达到最小值0,当 biclusters 不重叠的时候,并且当他们相同干的时候,最大值为1。
有些方法已经开发出来,用来比较两个 biclusters 的数据集。 从现在开始 之后
consensus_score(Hochreiter
et. al., 2010) 是可以用:
使用 Jaccard 索引或类似措施,计算 biclusters 的 bicluster 相似性。
以一对一的方式将 bicluster 分从一组分配给另一组,以最大化其相似性的总和。该步骤使用匈牙利算法执行。
相似性的最终总和除以较大集合的大小。
最小共识得分为0,发生在所有 biclusters 完全不相似时。当两组 biclusters 相同时,最大分数为1。
参考文献:
Hochreiter, Bodenhofer, et. al., 2010. FABIA: factor
analysis for bicluster acquisition.
中文文档: http://sklearn.apachecn.org/cn/stable/modules/biclustering.html
英文文档: http://sklearn.apachecn.org/en/stable/modules/biclustering.html
官方文档: http://scikit-learn.org/stable/
GitHub: https://github.com/apachecn/scikit-learn-doc-zh(觉得不错麻烦给个
Star,我们一直在努力)
贡献者: https://github.com/apachecn/scikit-learn-doc-zh#贡献者
关于我们: http://www.apachecn.org/organization/209.html
有兴趣的们也可以和我们一起来维护,持续更新中 。。。
机器学习交流群: 629470233
相关文章推荐
- 【Scikit-Learn 中文文档】二十一:聚类 - 无监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】双聚类 - 无监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】聚类 - 无监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】双聚类 - 无监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】双聚类 - 无监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】双聚类 - 无监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】集成方法 - 监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】聚类 - 无监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】随机梯度下降 - 监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】决策树 - 监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】双聚类 - 无监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】双聚类 - 无监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】双聚类 - 无监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】多类和多标签算法 - 监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】神经网络模块(监督的)- 监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】聚类 - 无监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】特征选择 - 监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】21 聚类 - 无监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】半监督学习 - 监督学习 - 用户指南 | ApacheCN
- 【Scikit-Learn 中文文档】聚类 - 无监督学习 - 用户指南 | ApacheCN