在分解模型之上构建的用于数据融合的python模块。
scikit-fusion的Python项目详细描述
scikit fusion是一个用于数据融合的python模块,它基于最新的 因子模型。
依赖关系
scikit fusion经过测试可以在python 3下工作。
构建软件所需的依赖项是numpy>;=1.7,scipy>;=0.12, pygraphviz>;=1.3(仅用于绘制数据融合图)和joblib>;=0.8.4。
安装
这个包使用distutils,这是默认的安装方式 python模块。要在主目录中安装,请使用:
python setup.py install --user
在UNIX/Linux上为所有用户安装:
python setup.py build sudo python setup.py install
对于开发模式使用:
python setup.py develop
用法
让我们生成三个描述三种不同对象类型的随机数据矩阵:
>>> import numpy as np >>> R12 = np.random.rand(50, 100) >>> R13 = np.random.rand(50, 40) >>> R23 = np.random.rand(100, 40)
接下来,我们定义数据融合图:
>>> from skfusion import fusion >>> t1 = fusion.ObjectType('Type 1', 10) >>> t2 = fusion.ObjectType('Type 2', 20) >>> t3 = fusion.ObjectType('Type 3', 30) >>> relations = [fusion.Relation(R12, t1, t2), fusion.Relation(R13, t1, t3), fusion.Relation(R23, t2, t3)] >>> fusion_graph = fusion.FusionGraph() >>> fusion_graph.add_relations_from(relations)
然后共同推断潜在数据模型:
>>> fuser = fusion.Dfmf() >>> fuser.fuse(fusion_graph) >>> print(fuser.factor(t1).shape) (50, 10)
之后可能会有新的数据:
>>> new_R12 = np.random.rand(10, 100) >>> new_R13 = np.random.rand(10, 40)
为此我们定义了融合图:
>>> new_relations = [fusion.Relation(new_R12, t1, t2), fusion.Relation(new_R13, t1, t3)] >>> new_graph = fusion.FusionGraph(new_relations)
并将新对象转换为由fuser:
>>> transformer = fusion.DfmfTransform() >>> transformer.transform(t1, new_graph, fuser) >>> print(transformer.factor(t1).shape) (10, 10)
scikit fusion与一些工作数据融合场景一起发布:
>>> from skfusion import datasets >>> dicty = datasets.load_dicty() >>> print(dicty) FusionGraph(Object types: 3, Relations: 3) >>> print(dicty.object_types) {ObjectType(GO term), ObjectType(Experimental condition), ObjectType(Gene)} >>> print(dicty.relations) {Relation(ObjectType(Gene), ObjectType(GO term)), Relation(ObjectType(Gene), ObjectType(Gene)), Relation(ObjectType(Gene), ObjectType(Experimental condition))}
相关链接
- 官方源代码回购:https://github.com/marinkaz/scikit-fusion
- HTML文档:TBA
- 下载版本:https://github.com/marinkaz/scikit-fusion/releases
- 问题跟踪程序:https://github.com/marinkaz/scikit-fusion/issues
- 矩阵分解数据融合:http://dx.doi.org/10.1109/TPAMI.2014.2343973
- 通过融合系统级分子数据发现疾病关联:http://www.nature.com/srep/2013/131115/srep03202/full/srep03202.html
- 基于矩阵分解的面包酵母和粘菌基因功能预测数据融合:http://www.worldscientific.com/doi/pdf/10.1142/9789814583220_0038
- 基于矩阵分解的药物性肝损伤预测数据融合:http://www.tandfonline.com/doi/abs/10.4161/sysb.29072
- 数据融合生存回归:http://www.tandfonline.com/doi/abs/10.1080/21628130.2015.1016702