Skip to content

Starting point for project 2 of the KR course 2021 at the VU

Notifications You must be signed in to change notification settings

Max-Faber/KR21_project2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bayesian Network Reasoner

This repository provides a BN reasoner, which parses Bayesian Networks from BIFXML files.

Prerequisites

  • Python 3.9 (for the typing feature)
  • A BIFXML file (examples in the /testing folder)
  • Dependencies (from the requirements.txt file)

Example usage

# TODO: remember to never use the same BNReasoner instance -> this can lead to unexpected behavior
if __name__ == '__main__':
    # Example usage
    print(BNReasoner('testing/lecture_example_pgm4.BIFXML').is_d_separated({'X'}, {'J'}, {'O'}))
    print(BNReasoner('testing/lecture_example_pgm4.BIFXML').compute_marginal_distribution({'J', 'I'}))
    print(BNReasoner('testing/lecture_example_pgm4.BIFXML').compute_marginal_distribution({'J', 'I'}, {'O': True}))
    print(BNReasoner('testing/lecture_example_pgm4.BIFXML').calculate_MPE({'O': True}))
    print(BNReasoner('testing/lecture_example_pgm4.BIFXML').calculate_MPE({'J': True, 'O': False}))

About

Starting point for project 2 of the KR course 2021 at the VU

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%