Skip to main content

Learning Bayesian Belief Networks with LASSO

Project description

pybbn logo

LASSO BBN

Learning Bayesian Belief Networks (BBNs) with LASSO. Example code is as below.

from lassobbn.learn import learn_parameters, learn_structure, to_bbn, to_join_tree, posteriors_to_df

# Step 1. Learn the structure
df_path = './data/data-binary.csv'
meta_path = './data/data-binary-complete.json'

parents = learn_structure(df_path, meta_path, n_way=2, ignore_neg_gt=-0.01, ignore_pos_lt=0.05)

# Step 2. Learn the parameters
d, g, p = learn_parameters(df_path, parents)

# Step 3. Get the BBN
bbn = to_bbn(d, g, p)

# Step 4. Get the Join Tree
jt = to_join_tree(bbn)

You can then use Py-BBN to create a BBN and join tree (JT) instance and perform exact inference.

Installation

pip install lassobbn

Links

Additional APIs

turing_bbn pyspark-bbn
turing_bbn logo pyspark-bbn logo
  • turing_bbn is a C++17 implementation of py-bbn; take your causal and probabilistic inferences to the next computing level!
  • pyspark-bbn is a is a scalable, massively parallel processing MPP framework for learning structures and parameters of Bayesian Belief Networks BBNs using Apache Spark.

Citation

@misc{alemi_2021,
title={lasso-bbn},
url={https://lasso-bbn.readthedocs.io/},
author={F. Alemi, J. Vang},
year={2021},
month={Aug}}

Copyright Stuff

Software

Copyright 2021 Farrokh Alemi and Jee Vang

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Art Copyright

Copyright 2021 Daytchia Vang

Sponsor, Love

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

lassobbn-1.0.0.tar.gz (8.4 kB view hashes)

Uploaded Source

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