bn_testing
A test framework to evaluate methods that learn Bayesian Networks from high-dimensional observed data. It provides helpers to construct Bayesian networks in a randomized fashion and helps sampling observational data from it. Its not a framework to fit Bayesian networks on data!
Note
Currently, only additive models are supported.
Quick start
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
Note
This project is under active development.
Contents
- Usage
- Graph construction
- Conditionals
- Terms
- Interventions
- Examples
- API
- bn_testing
- bn_testing package
- Submodules
- bn_testing.conditionals module
- bn_testing.dags module
- bn_testing.helpers module
- bn_testing.models module
BayesianNetwork
BayesianNetwork.compute_average_causal_effect()
BayesianNetwork.compute_varsortability()
BayesianNetwork.edges
BayesianNetwork.generate()
BayesianNetwork.hidden_nodes
BayesianNetwork.is_source()
BayesianNetwork.load()
BayesianNetwork.modify_inner_node()
BayesianNetwork.modify_node()
BayesianNetwork.modify_source_node()
BayesianNetwork.nodes
BayesianNetwork.sample()
BayesianNetwork.save()
BayesianNetwork.show()
BayesianNetwork.visible_nodes
- bn_testing.terms module
- Module contents
- bn_testing package
- bn_testing