Skip to content

Commit

Permalink
Configure docs building.
Browse files Browse the repository at this point in the history
  • Loading branch information
knifecake committed Jun 5, 2022
1 parent d07f6e2 commit 41f031f
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 33 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
Expand Down
13 changes: 13 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
build:
os: ubuntu-20.04
tools:
python: "3.9"
sphinx:
configuration: docs/conf.py
formats:
- pdf
python:
install:
- requirements: requirements.txt
- requirements: requirements.dev.txt
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# v0

## v0.1

### v0.1.2 - 2022-06-05

- Make documentation available as a website through readthedocs.io

### v0.1.1 - 2022-06-05

- Fixed wrong minimum Python version in package metadata.
- Updated README.md with more information about the package.

### v0.1.0 - 2022-06-05

Initial public release
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# lgbn

Structure learning for linear Gaussian Bayesian networks.
[![Documentation Status](https://readthedocs.org/projects/lgbn/badge/?version=latest)](https://lgbn.readthedocs.io/en/latest/?badge=latest)

Structure and parameter learning for linear Gaussian Bayesian networks.

This package provides structure learning of linear Gaussian Bayesian networks via score-based search algorithms. Available algorithms include K2, Greedy Hill Climbing and Greedy Equivalent Search. Available scores include the Log Likelihood score and the Bayesian Information Criterion score.

This is a well-tested (with 100% coverage) and well-documented (full API documentation + design and usage guides) package that focuses on training for a particular kind of Bayesian network: those in which every node has a Gaussian distribution where the mean is a linear combination of the parent nodes plus a bias factor and where the variances are independent across all nodes. This particular kind of Bayesian network has applications in all sorts of problems involving continuous data, even if the distribution of the data itself is not Gaussian.

To our knowledge, this is the only available Python package able to work with these kinds of structures and data. Other Bayesian network packages such as [pgmpy](https://github.com/pgmpy/pgmpy) have not yet implemented continuous Gaussian nodes with the restrictions mentioned before. There exists software in other programming languages such as the [Bayesian Network Toolbox](https://github.com/bayesnet/bnt) (BNT) for MatLab, last released in 2003 or the R package [bnlearn](https://www.bnlearn.com/) which is actively maintained. We have used both as reference implementations and verified that the results obtained with this package match those returned by BNT and bnlearn with a relative error less than one part per million.

## Documentation

Documentation for this package is available online at https://lgbn.readthedocs.io/en/latest/

## Development

Expand Down Expand Up @@ -33,7 +45,7 @@ Test coverage can be measured with coverage.py:

Ensure you have installed all dev dependencies. Then run

python3 setup.py sdist
python3 -m build

from the repository root. This will build the package and place it under `dist/lgbn-x.y.z.tar.gz`. You can install it on your own machine by running

Expand All @@ -53,6 +65,13 @@ Documentation can be compiled in to a set of HTML documents plus many other form
cd docs
make html

### Uploading the package to PyPI

Build the package and execute

python3 -m twine upload dist/*

After that you will be asked for credentials and the updated package will be available for installation with `pip install lgbn`.

## Acknowledgements

Expand Down
4 changes: 3 additions & 1 deletion requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
yapf==0.31.0
Sphinx==5.0.1
coverage==6.4.1
coverage==6.4.1
build==0.8.0
twine==4.0.1
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ networkx>=2.8
pandas>=1.4

# Estimators
scikit-learn >= 1.1
scikit-learn>= 1.1
24 changes: 0 additions & 24 deletions setup.cfg

This file was deleted.

30 changes: 28 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
from setuptools import setup
import setuptools

setup()
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

setuptools.setup(
name="lgbn",
version="0.1.2",
author="Elias Hernandis",
author_email="[email protected]",
description="Structure and parameter learning for linear Gaussian Bayesian networks.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/knifecake/lgbn",
project_urls={
"Bug Tracker": "https://github.com/knifecake/lgbn/issues",
"Documentation": "https://lgbn.readthedocs.io/en/latest/"
},
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3 :: Only",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
packages=setuptools.find_packages(include=['lgbn', 'lgbn.*']),
python_requires=">=3.9",
install_requires=['scipy >= 1.8', 'networkx >= 2.8', 'pandas >= 1.4', 'scikit-learn >= 1.1']
)

0 comments on commit 41f031f

Please sign in to comment.