Giter Site home page Giter Site logo

Comments (4)

irwincong avatar irwincong commented on August 16, 2024

Hi @elia-maracani ,

We will look into this. Do you have some example code for us to replicate this error?

Thanks

from libpgm.

communikein avatar communikein commented on August 16, 2024

Hi @irwincong ,

Yeah sure, at this github repository you can find all you need to try it, let me know.

Thanks

from libpgm.

irwincong avatar irwincong commented on August 16, 2024

Hi @elia-maracani,

Agreed that there is a source code issue as you pointed out -- variable usage without prior declaration. An internal version of the code has progressed since and has been refactored a bit, and it does not exhibit this error. We are currently working through how to best update this external repository. @cccabot - Do you have any suggested workarounds while we work through this?

Also, please note that the dictionary that you are using in your repo to construct the discrete node seems to be different from what the Discrete() class has documented, specifically, the 'cprob' portion. If you uncomment line 44 in examples/examples.py, you would get something like the following.

  "Grade": {
    "vals": [
      "C", 
      "B", 
      "A"
    ], 
    "numoutcomes": 3, 
    "cprob": {
      "['high', 'easy']": [
        0.0, 
        0.029411764705882353, 
        0.9705882352941176
      ], 
      "['low', 'easy']": [
        0.23529411764705882, 
        0.3764705882352941, 
        0.38823529411764707
      ], 
      "['low', 'hard']": [
        0.7547169811320755, 
        0.20754716981132076, 
        0.03773584905660377
      ], 
      "['high', 'hard']": [
        0.25, 
        0.42857142857142855, 
        0.32142857142857145
      ]
    }, 
    "parents": [
      "Intelligence", 
      "Difficulty"
    ], 
    "children": [
      "Letter"
    ]
  }, 

Regards

from libpgm.

cccabot avatar cccabot commented on August 16, 2024

Hi @elia-maracani @irwincong it looks like a bug to me. Short of deleting line 71 I cannot think of a workaround. It looks like it doesn't break if the discrete node is a root node -- which is tested in example (3). But the case with a discrete non-root node (which triggers the bug) is not covered by the examples or tests.

from libpgm.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.