Skip to content

Provide a bridge to PyGOBN #6

@smarie

Description

@smarie

From PyGOBN doc:

>>> gobn = GOBN()
>>> edge_reqs = {'A':['B','C'],'B':['D']} # require that A->B, A->C, and B->D
>>> ind_reqs = [('A','D'),(('A','B'),'D','C')] # require that A _|_ D and A,B _|_ D | C
>>> nonedge_reqs = {'B':['C']} # disallow that B->C
>>> gobn.set_constraints(edge_reqs, ind_reqs, nonedge_reqs)
>>> gobn.learn(data) # Call the GOBNILP solver

So we can maybe provide a <QDForest>.to_pygobn() method that would return a tuple edge_reqs, ind_reqs, and nonedge_reqs. The user would therefore do:

from qdscreeen import qdeterscreen
from pyGOBN import GOBN

# screen for (quasi-)determinism and get the contraints to pass to GOBN
qd_forest = qdeterscreen(data[, options])
reqs = qd_forest.to_pygobn()

# run GOBN with these constraints
gobn = GOBN()
gobn.set_constraints(*reqs)
gobn.learn(data)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions