Closed ryankarlos closed 2 years ago
Just an update, I tried downgrading to pomegranate 0.10.0 and python 3.6 as per the version used in #500. --- this works for me and returns the structure, which is confusing as to why it wouldnt work for the latest version and python 3.8 -- unless there are some versions of other packages installed which are causing the pomegranate build to not complete properly ?
>>> import pomegranate
>>> pomegranate.__version__
'0.10.0'
>>> from pomegranate import BayesianNetwork
>>> import numpy as np
>>> x = np.random.choice(20,(2, 2))
>>> BayesianNetwork.from_samples(x)
{
"class" : "BayesianNetwork",
"name" : "140243768229056",
"structure" : [
[],
[
0
]
],
"states" : [
{
"class" : "State",
"distribution" : {
"class" : "Distribution",
"dtype" : "numpy.int64",
"name" : "DiscreteDistribution",
"parameters" : [
{
"3" : 0.5,
"18" : 0.5
}
],
"frozen" : false
},
"name" : "0",
"weight" : 1.0
},
{
"class" : "State",
"distribution" : {
"class" : "Distribution",
"name" : "ConditionalProbabilityTable",
"table" : [
[
"3",
"1",
"0.0"
],
[
"3",
"16",
"1.0"
],
[
"18",
"1",
"1.0"
],
[
"18",
"16",
"0.0"
]
],
"dtypes" : [
"numpy.int64",
"numpy.int64",
"float"
],
"parents" : [
{
"class" : "Distribution",
"dtype" : "numpy.int64",
"name" : "DiscreteDistribution",
"parameters" : [
{
"3" : 0.5,
"18" : 0.5
}
],
"frozen" : false
}
]
},
"name" : "1",
"weight" : 1.0
}
]
}
pomegranate hasn't used izip for a long time. I'm guessing that had an older version installed that was not being properly tracked by the package manager.
Hello @jmschrei. Firstly, thanks for the great package !
i was trying to use the from_samples option and was getting the following error (example code snippet to reproduce below) - using python 3.8 and latest pomegranate version 0.14.4.
is this a bug as python 3x uses inbuilt
zip
rather thanitertools.izip
?