Closed agcgit closed 1 year ago
Can you check the version of pgmpy that you are using?
import pgmpy
pgmpy.__version__
I use version '0.1.18' which does not give this error.
If you have a older version, try to update first with: pip install -U pgmpy
my version of pgmpy is '0.1.20', I tried to to downgrade to 0.1.18 but it still giving giving the same error
If you try the colab notebook example, does it also throw an error?
error in colab notebook
TypeError Traceback (most recent call last)
TypeError: sampling() got an unexpected keyword argument 'methodtype'
however if I remove the methodtype argument its working.
It seems that many packages require Python >3.8 or higher. Colab runs in python 3.7 (I did not realize this) and therefore older versions of packages are installed (including bnlearn). But try to create an environment with >python3.8, (3.10 or so). This will likely solve your issue.
I am closing this issue. Please re-open if required.
The following code result in error
I'm using python 3.8
Import library
import bnlearn as bn print(bn.version)
model = bn.import_DAG('sprinkler', CPD=True) df = bn.sampling(model, n=1000, methodtype='bayes')
df.head()