pgmpy / pgmpy_notebook

Short Tutorial to Probabilistic Graphical Models(PGM) and pgmpy
http://pgmpy.org/
MIT License
368 stars 213 forks source link

ImportError: cannot import name 'BDeuScore' from 'pgmpy.estimators.BDeuScore' #41

Closed SrGrace closed 4 years ago

SrGrace commented 4 years ago
from pgmpy.estimators import ParameterEstimator
pe = ParameterEstimator(model, data)
print("\n", pe.state_counts('fruit'))  # unconditional
print("\n", pe.state_counts('tasty'))  # conditional on fruit and size
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
 in 
----> 1 from pgmpy.estimators import ParameterEstimator
      2 pe = ParameterEstimator(model, data)
      3 print("\n", pe.state_counts('fruit'))  # unconditional
      4 print("\n", pe.state_counts('tasty'))  # conditional on fruit and size

C:\ProgramData\Anaconda3\lib\site-packages\pgmpy\estimators\__init__.py in 
      4 from pgmpy.estimators.StructureScore import StructureScore
      5 from pgmpy.estimators.K2Score import K2Score
----> 6 from pgmpy.estimators.BDeuScore import BDeuScore
      7 from pgmpy.estimators.BicScore import BicScore
      8 from pgmpy.estimators.ExhaustiveSearch import ExhaustiveSearch

ImportError: cannot import name 'BDeuScore' from 'pgmpy.estimators.BDeuScore'

Python version: 3.7.6 pgmpy version: pgmpy==0.1.10

ankurankan commented 4 years ago

@SrGrace This has been fixed now. Please try installing the latest dev branch on github.

SrGrace commented 4 years ago

@ankurankan Installing through pip should work fine, right?

Anyways, Reinstalled with conda, now working fine, Thanks!

ankurankan commented 4 years ago

@SrGrace No, the pip version seems to be broken. Will need to install from source: https://github.com/pgmpy/pgmpy#installation