建立在分解模型之上的用于数据融合的 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)
并将新对象转换为由融合器引起的潜在空间:
>>> 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))}
相关链接
HTML 文档:待定
通过矩阵分解进行数据融合: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