Giter Site home page Giter Site logo

bn_testing's Introduction

BN testing

Test Package Documentation Status PyPI

A test framework to evaluate methods that learn Bayesian Networks from high-dimensional observational data.

Sampling

Set up the graphical model and sample data

from bn_testing.models import BayesianNetwork
from bn_testing.dags import ErdosReny
from bn_testing.conditionals import PolynomialConditional


model = BayesianNetwork(
   dag=ErdosReny(p=0.01, n_nodes=100),
   conditionals=PolynomialConditional(max_terms=5)
)

df = model.sample(10000, normalize=True)

The observations are stored in a pandas.DataFrame where the columns are the nodes of the DAG and each row is an observation. The underlying DAG of the graphical model can be accessed with model.dag

bn_testing's People

Contributors

windisch avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

azeller14

bn_testing's Issues

Allow variable transforms in terms

Add parameter that allows to transforms a (selection?) of the variables before applying a term.

For instance, it should be possible in the term Polynomial(["X", "Y"], [[1, -1]], [1]) that the the variable Y is replaced with exp(Y) before the term is applied to avoid divisions by zero errors.

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.