pysmile - learning

The engine.
Post Reply
dvrebos
Posts: 6
Joined: Thu Jun 08, 2017 10:24 am

pysmile - learning

Post by dvrebos » Thu Mar 29, 2018 9:27 am

I've been trying different learning algorithms in pysmile. But I have some questions regarding the available options.

Is Essential Graph Search incorporated in pysmile? I doesn't seem to be available.

dir(pysmile.learning)
['__doc__',
'__name__',
'__package__',
'bayesian_search',
'bk_knowledge',
'data_match',
'dataset',
'em',
'greedy_thick_thinning',
'naive_bayes',
'pattern',
'pc',
'tan',
'validator']


While bayesian_search provides the option to set to a maximum run time "set_max_search_time". This option isn't available in "pc". Is there a way to limit the runtime of this search algorithm?

shooltz[BayesFusion]
Site Admin
Posts: 1269
Joined: Mon Nov 26, 2007 5:51 pm

Re: pysmile - learning

Post by shooltz[BayesFusion] » Fri Mar 30, 2018 10:48 pm

Essential Search is not available in SMILE Wrappers. It's only accessible from C++ at this point.
It's the same with PC's max search time; it's a C++ only feature.

dvrebos
Posts: 6
Joined: Thu Jun 08, 2017 10:24 am

Re: pysmile - learning

Post by dvrebos » Tue Apr 03, 2018 1:03 pm

Thanks for the explenation.

I have an additional question regarding match_network() and validator(). I've been trying to test this using one of the older examples available: https://dslpitt.org/genie/wiki/File:Net_tut_5.xdsl

with the data in a datafile: Net_tut_5.txt
  • A B C
    t t t
    t f f
    f t f
    f f f
    t t t
    t f t
    f t f
    f f t
When applying these data I use the following code

Code: Select all

import pysmile
pysmile.license(...)

# read dataset
Dataset = pysmile.learning.dataset()
Dataset.read_file("Net_tut_5.txt")

# open BBN
Net = pysmile.network()
Net.read_file("Net_tut_5.xdsl")

# create data_match
Matched_List  = Dataset.match_network(Net)

# validate network
Validation = pysmile.learning.validator(Net,Dataset,Matched_List)
However I keep getting an error during the data_matching which is not clear to me.
ValueError: learning.dataset.match_network raised exception!
errno = -4
Do you have any idea what I do wrong?
Are there specific rules for the headers in the datafile and the node_ids in the network when using match_network() and validator()? Or can I use any word I would like?

piotr [BayesFusion]
Site Admin
Posts: 29
Joined: Mon Nov 06, 2017 6:41 pm

Re: pysmile - learning

Post by piotr [BayesFusion] » Tue Apr 03, 2018 2:15 pm

I'm assuming, that your Dataset isn't corresponding with Network.
Net_tut_5.xdsl has states named State0/State1 instead of t/f from Dataset.

Post Reply