README.rst
1.. -*- mode: rst -*-
2
3=============
4scikit-fusion
5=============
6
7|Travis|_
8
9.. |Travis| image:: https://travis-ci.org/marinkaz/scikit-fusion.svg?branch=master
10.. _Travis: https://travis-ci.org/marinkaz/scikit-fusion
11
12*scikit-fusion* is a Python module for data fusion based on recent collective latent
13factor models.
14
15Dependencies
16============
17
18scikit-fusion is tested to work under Python 3.
19
20The required dependencies to build the software are Numpy >= 1.7, SciPy >= 0.12,
21PyGraphviz >= 1.3 (needed only for drawing data fusion graphs) and Joblib >= 0.8.4.
22
23Install
24=======
25
26This package uses distutils, which is the default way of installing
27python modules. To install in your home directory, use::
28
29 python setup.py install --user
30
31To install for all users on Unix/Linux::
32
33 python setup.py build
34 sudo python setup.py install
35
36For development mode use::
37
38 python setup.py develop
39
40Usage
41=====
42
43Let's generate three random data matrices describing three different object types::
44
45 >>> import numpy as np
46 >>> R12 = np.random.rand(50, 100)
47 >>> R13 = np.random.rand(50, 40)
48 >>> R23 = np.random.rand(100, 40)
49
50Next, we define our data fusion graph::
51
52 >>> from skfusion import fusion
53 >>> t1 = fusion.ObjectType('Type 1', 10)
54 >>> t2 = fusion.ObjectType('Type 2', 20)
55 >>> t3 = fusion.ObjectType('Type 3', 30)
56 >>> relations = [fusion.Relation(R12, t1, t2),
57 fusion.Relation(R13, t1, t3),
58 fusion.Relation(R23, t2, t3)]
59 >>> fusion_graph = fusion.FusionGraph()
60 >>> fusion_graph.add_relations_from(relations)
61
62and then collectively infer the latent data model::
63
64 >>> fuser = fusion.Dfmf()
65 >>> fuser.fuse(fusion_graph)
66 >>> print(fuser.factor(t1).shape)
67 (50, 10)
68
69
70Afterwards new data might arrive::
71
72 >>> new_R12 = np.random.rand(10, 100)
73 >>> new_R13 = np.random.rand(10, 40)
74
75for which we define the fusion graph::
76
77 >>> new_relations = [fusion.Relation(new_R12, t1, t2),
78 fusion.Relation(new_R13, t1, t3)]
79 >>> new_graph = fusion.FusionGraph(new_relations)
80
81and transform new objects to the latent space induced by the ``fuser``::
82
83 >>> transformer = fusion.DfmfTransform()
84 >>> transformer.transform(t1, new_graph, fuser)
85 >>> print(transformer.factor(t1).shape)
86 (10, 10)
87
88****
89
90scikit-fusion is distributed with a few working data fusion scenarios::
91
92 >>> from skfusion import datasets
93 >>> dicty = datasets.load_dicty()
94 >>> print(dicty)
95 FusionGraph(Object types: 3, Relations: 3)
96 >>> print(dicty.object_types)
97 {ObjectType(GO term), ObjectType(Experimental condition), ObjectType(Gene)}
98 >>> print(dicty.relations)
99 {Relation(ObjectType(Gene), ObjectType(GO term)),
100 Relation(ObjectType(Gene), ObjectType(Gene)),
101 Relation(ObjectType(Gene), ObjectType(Experimental condition))}
102
103Relevant links
104==============
105
106- Official source code repo: https://github.com/marinkaz/scikit-fusion
107- HTML documentation: TBA
108- Download releases: https://github.com/marinkaz/scikit-fusion/releases
109- Issue tracker: https://github.com/marinkaz/scikit-fusion/issues
110
111****
112
113- Data fusion by matrix factorization: http://dx.doi.org/10.1109/TPAMI.2014.2343973
114- Discovering disease-disease associations by fusing systems-level molecular data: http://www.nature.com/srep/2013/131115/srep03202/full/srep03202.html
115- Matrix factorization-based data fusion for gene function prediction in baker's yeast and slime mold: http://www.worldscientific.com/doi/pdf/10.1142/9789814583220_0038
116- Matrix factorization-based data fusion for drug-induced liver injury prediction: http://www.tandfonline.com/doi/abs/10.4161/sysb.29072
117- Survival regression by data fusion: http://www.tandfonline.com/doi/abs/10.1080/21628130.2015.1016702
118