Skip to main content

A test bench to benchmark learn algorithms for graphical models

Project description

BN testing

Documentation Status PyPI

A test framework to evaluate methods that learn Bayesian Networks from high-dimensional observed 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(
   n_nodes=100,
   dag=ErdosReny(p=0.01),
   conditionals=PolynomialConditional(max_terms=5)
)

df = model.sample(10000)

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bn_testing-0.6.0.tar.gz (19.6 kB view hashes)

Uploaded Source

Built Distribution

bn_testing-0.6.0-py3-none-any.whl (20.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page