mims-harvard / scikit-fusion

scikit-fusion: Data fusion via collective latent factor models
Other
144 stars 42 forks source link

Small dimensions problems #8

Open miha-skalic opened 9 years ago

miha-skalic commented 9 years ago

Two issues occur when working with small samples:

import numpy as np
from skfusion import fusion

R12 = np.random.rand(30, 40)
R23 = np.random.rand(40, 50)

t1 = fusion.ObjectType('Type 1', 2)
t2 = fusion.ObjectType('Type 2', 9)
t3 = fusion.ObjectType('Type 3', 1)

relations = [fusion.Relation(R12, t1, t2),
             fusion.Relation(R23, t2, t3)]
fusion_graph = fusion.FusionGraph(relations)

fuser = fusion.Dfmf()
fuser.fuse(fusion_graph)

yields: KeyError: (ObjectType("Type 1"), ObjectType("Type 3")) the code works if t3 rank is >= 2

Running:

import numpy as np
from skfusion import fusion

R12 = np.random.rand(30, 4)
R23 = np.random.rand(4, 50)

t1 = fusion.ObjectType('Type 1', 2)
t2 = fusion.ObjectType('Type 2', 9)
t3 = fusion.ObjectType('Type 3', 2)

relations = [fusion.Relation(R12, t1, t2),
             fusion.Relation(R23, t2, t3)]
fusion_graph = fusion.FusionGraph(relations)

fuser = fusion.Dfmf()
fuser.fuse(fusion_graph)

yield numpy warning and reconstructed matrices have NaN. This works if R12 has second dimension greater than 4.

niloole commented 5 years ago

I want to run a program that predict gene function, but when I run that code error happen that "'Dfmf' object has no attribute 'set_scheme'" I see code of dfmf but there isn't set_scheme. how can i correct it?