Learning Bayesian Belief Networks with LASSO
Project description
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 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
Release history Release notifications | RSS feed
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 details)
File details
Details for the file lassobbn-1.0.0.tar.gz
.
File metadata
- Download URL: lassobbn-1.0.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8461773520f96a05abbdda2ff432c1c2062f42ee331bfff8f993ecc83601e27d |
|
MD5 | a8f5cabc91a731e05572fb96bb584da4 |
|
BLAKE2b-256 | 78dad1e833b4c0a37fb8b042a91f2ce9e555b302bceba41d09ceb789670aff82 |