Giter Site home page Giter Site logo

giorgiaauroraadorni / likelihood-weighting-sampling Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 29 KB

A Python implementation of the likelihood weighting approach for Bayesian Network sampling. Fourth assignment for Probabilistic Models for Decisions course @unimib18/19.

License: GNU General Public License v3.0

Python 100.00%
bayesian-network decision-making likelihood likelihood-weighting network-sampling probabilistic-models probabilistic-programming

likelihood-weighting-sampling's Introduction

Likelihood Weighting

A Python implementation of the likelihood weighting approach for Bayesian Network sampling.

Fourth assignment for Probabilistic Models for Decisions course @ Unimib 18/19.

Prerequisites

  • Python 3.0 or greater

Installation

$ git clone https://github.com/GiorgiaAuroraAdorni/likelihood-weighting-sampling
$ cd likelihood-weighting-sampling

Authors

likelihood-weighting-sampling's People

Contributors

dependabot[bot] avatar giorgiaauroraadorni avatar

Stargazers

 avatar

Watchers

 avatar  avatar

likelihood-weighting-sampling's Issues

Clarification of some codes

Thanks for your coding. I have some difficulties in understanding the following code.

Q1.
What is the purpose of the following code?

for j, el in enumerate(parents_value):
exp = len(parents_value) - j - 1
acc = el * (2**exp)

Q2,
And, for probA_W, I have the difficulty in understanding the meaning of row index
True False
0 0.3 0.7
1 0.1 0.9

For row index 0, is it W = True
For row index 1, is it W = False

Am I right?

Q3
Probability table Traffic Jam, I have the difficulty in understanding the meaning of row index
True False
0 0.10 0.90
1 0.60 0.40
2 0.30 0.70
3 0.50 0.50
4 0.95 0.05
5 0.95 0.05
6 0.95 0.05
7 0.95 0.05

For row index 0, is it H = True, W = True, A = True
For row index 1, is it H = True, W = True, A = False
For row index 2, is it H = True, W = False, A = True
For row index 3, is it H = True, W = False, A = False
For row index 4, is it H = False, W = True, A = True
For row index 5, is it H = False, W = True, A = False
For row index 6, is it H = False, W = False, A = True
For row index 7, is it H = False, W = False, A = False

Am I right?

Again, thanks for your sharing

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.