Skip to content

Release 0.3.0 #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 28 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Document Author
Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
Shota Saito <shota.s@gunma-u.ac.jp>
-->
<div align="center">
<b>Our algorithm for the meta-tree model is accepted at AISTATS 2025! Click <a href="https://bayesml.github.io/BayesML/examples/metatree_prediction_interval.html">here</a>!</b>
</div>

<img src="./doc/logos/BayesML_logo.png" width="600">

## Purpose
Expand All @@ -17,7 +21,11 @@ BayesML has the following characteristics.
* Many of our learning algorithms are much faster than general-purpose Bayesian learning algorithms such as MCMC methods because they effectively use the conjugate property of a probabilistic data generative model and a prior distribution. Moreover, they are suitable for online learning.
* All packages have methods to visualize the probabilistic data generative model, generated data from that model, and the posterior distribution learned from the data in 2~3 dimensional space. Thus, you can effectively understand the characteristics of probabilistic data generative models and algorithms through the generation of synthetic data and learning from them.

For more details, see our [website](https://yuta-nakahara.github.io/BayesML/ "BayesML's Documentation").
For more details, see our [website](https://bayesml.github.io/BayesML/ "BayesML's Documentation").

## News

* Our algorithm for the meta-tree model is accepted at AISTATS 2025! A sample code is [here](https://bayesml.github.io/BayesML/examples/metatree_prediction_interval.html).

## Installation

Expand Down Expand Up @@ -110,18 +118,18 @@ Different settings of a loss function yield different optimal estimates.

The following packages are currently available. In this library, a probabilistic data generative model, prior distribution, posterior distribution (or approximate posterior distribution), and predictive distribution (or approximate predictive distribution) are collectively called a model.

* [Bernoulli model](https://yuta-nakahara.github.io/BayesML/bayesml.bernoulli.html "Bayesml Bernoulli Model")
* [Categorical model](https://yuta-nakahara.github.io/BayesML/bayesml.categorical.html "BayesML Categorical Model")
* [Poisson model](https://yuta-nakahara.github.io/BayesML/bayesml.poisson.html "BayesML Poisson Model")
* [Normal model](https://yuta-nakahara.github.io/BayesML/bayesml.normal.html "BayesML Normal Model")
* [Multivariate normal model](https://yuta-nakahara.github.io/BayesML/bayesml.multivariate_normal.html "BayesML Multivariate Normal Model")
* [Exponential model](https://yuta-nakahara.github.io/BayesML/bayesml.exponential.html "BayesML Exponential Model")
* [Gaussian mixture model](https://yuta-nakahara.github.io/BayesML/bayesml.gaussianmixture.html "BayesML Gaussian Mixture Model")
* [Linear regression model](https://yuta-nakahara.github.io/BayesML/bayesml.linearregression.html "BayesML Lenear Regression Model")
* [Meta-tree model](https://yuta-nakahara.github.io/BayesML/bayesml.metatree.html "BayesML Meta-tree Model")
* [Autoregressive model](https://yuta-nakahara.github.io/BayesML/bayesml.autoregressive.html "BayesML Autoregressive Model")
* [Hidden Markov normal model](https://yuta-nakahara.github.io/BayesML/bayesml.hiddenmarkovnormal.html "BayesML Hidden Markov Normal Model")
* [Context tree model](https://yuta-nakahara.github.io/BayesML/bayesml.contexttree.html "BayesML Context Tree Model")
* [Bernoulli model](https://bayesml.github.io/BayesML/bayesml.bernoulli.html "Bayesml Bernoulli Model")
* [Categorical model](https://bayesml.github.io/BayesML/bayesml.categorical.html "BayesML Categorical Model")
* [Poisson model](https://bayesml.github.io/BayesML/bayesml.poisson.html "BayesML Poisson Model")
* [Normal model](https://bayesml.github.io/BayesML/bayesml.normal.html "BayesML Normal Model")
* [Multivariate normal model](https://bayesml.github.io/BayesML/bayesml.multivariate_normal.html "BayesML Multivariate Normal Model")
* [Exponential model](https://bayesml.github.io/BayesML/bayesml.exponential.html "BayesML Exponential Model")
* [Gaussian mixture model](https://bayesml.github.io/BayesML/bayesml.gaussianmixture.html "BayesML Gaussian Mixture Model")
* [Linear regression model](https://bayesml.github.io/BayesML/bayesml.linearregression.html "BayesML Lenear Regression Model")
* [Meta-tree model](https://bayesml.github.io/BayesML/bayesml.metatree.html "BayesML Meta-tree Model")
* [Autoregressive model](https://bayesml.github.io/BayesML/bayesml.autoregressive.html "BayesML Autoregressive Model")
* [Hidden Markov normal model](https://bayesml.github.io/BayesML/bayesml.hiddenmarkovnormal.html "BayesML Hidden Markov Normal Model")
* [Context tree model](https://bayesml.github.io/BayesML/bayesml.contexttree.html "BayesML Context Tree Model")

In the future, we will add packages to deal with more complicated hierarchical models.

Expand All @@ -137,8 +145,9 @@ Plain text

```
Y. Nakahara, N. Ichijo, K. Shimada, Y. Iikubo,
S. Saito, K. Kazama, T. Matsushima, BayesML Developers, ``BayesML 0.2.5,''
[Online] https://github.com/yuta-nakahara/BayesML
S. Saito, K. Kazama, T. Matsushima, BayesML Developers, ``BayesML,''
Python package version 0.3.0,
[Online] https://github.com/bayesml/BayesML
```

BibTeX
Expand All @@ -148,8 +157,9 @@ BibTeX
author = {Nakahara, Yuta and Ichijo, Naoki and Shimada, Koshi and
Iikubo, Yuji and Saito, Shota and Kazama, Koki and
Matsushima, Toshiyasu and {BayesML Developers}},
title = {BayesML 0.2.5},
howpublished = {\url{https://github.com/yuta-nakahara/BayesML}},
year = {2022}
title = {{BayesML}},
howpublished = {Python package version 0.3.0},
note = {\url{https://github.com/bayesml/BayesML}},
year = {2025}
}
```
46 changes: 28 additions & 18 deletions README_jp.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Document Author
Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
-->
<div align="center">
<b>メタツリーモデルに対するアルゴリズムがAISTATS 2025に採択!詳細は<a href="https://bayesml.github.io/BayesML/examples/metatree_prediction_interval.html">こちら</a>!</b>
</div>

<img src="./doc/logos/BayesML_logo.png" width="600">

## 目的
Expand All @@ -16,7 +20,11 @@ BayesMLは以下の特徴を持っています.
* 学習アルゴリズムの多くはデータ生成確率モデルと事前分布の共役性を効果的に用いているため,MCMC法などの汎用的なベイズ学習アルゴリズムと比べて非常に高速で,オンライン学習にも適しています.
* 2~3次元空間上で,データ生成確率モデル,生成された人工データ,学習された事後分布を可視化するメソッドが全てのパッケージに備わっています.そのため,人工データの生成と学習を通じて確率モデル,アルゴリズムの特性を効果的に把握することができます.

詳細は[Webサイト](https://yuta-nakahara.github.io/BayesML/ "BayesML's Documentation")をご覧ください.
詳細は[Webサイト](https://bayesml.github.io/BayesML/ "BayesML's Documentation")をご覧ください.

## ニュース

* メタツリーモデルに対するアルゴリズムがAISTATS 2025に採択されました.サンプルコードは[こちら](https://bayesml.github.io/BayesML/examples/metatree_prediction_interval.html)をご覧ください.

## インストール

Expand Down Expand Up @@ -107,18 +115,18 @@ print(learn_model.estimate_params(loss='0-1'))

現在,以下のモデルに関するパッケージが利用可能です.本ライブラリでは,データ生成確率モデル,事前分布,事後分布(または近似事後分布),予測分布(または近似予測分布)を合わせてモデルと呼んでいます.

* [ベルヌーイモデル](https://yuta-nakahara.github.io/BayesML/bayesml.bernoulli.html "Bayesml Bernoulli Model")
* [カテゴリカルモデル](https://yuta-nakahara.github.io/BayesML/bayesml.categorical.html "BayesML Categorical Model")
* [ポアソンモデル](https://yuta-nakahara.github.io/BayesML/bayesml.poisson.html "BayesML Poisson Model")
* [正規モデル](https://yuta-nakahara.github.io/BayesML/bayesml.normal.html "BayesML Normal Model")
* [多変量正規モデル](https://yuta-nakahara.github.io/BayesML/bayesml.multivariate_normal.html "BayesML Multivariate Normal Model")
* [指数モデル](https://yuta-nakahara.github.io/BayesML/bayesml.exponential.html "BayesML Exponential Model")
* [混合正規モデル](https://yuta-nakahara.github.io/BayesML/bayesml.gaussianmixture.html "BayesML Gaussian Mixture Model")
* [線形回帰モデル](https://yuta-nakahara.github.io/BayesML/bayesml.linearregression.html "BayesML Lenear Regression Model")
* [メタツリーモデル](https://yuta-nakahara.github.io/BayesML/bayesml.metatree.html "BayesML Meta-tree Model")
* [自己回帰モデル](https://yuta-nakahara.github.io/BayesML/bayesml.autoregressive.html "BayesML Autoregressive Model")
* [隠れマルコフモデル](https://yuta-nakahara.github.io/BayesML/bayesml.hiddenmarkovnormal.html "BayesML Hidden Markov Normal Model")
* [文脈木モデル](https://yuta-nakahara.github.io/BayesML/bayesml.contexttree.html "BayesML Context Tree Model")
* [ベルヌーイモデル](https://bayesml.github.io/BayesML/bayesml.bernoulli.html "Bayesml Bernoulli Model")
* [カテゴリカルモデル](https://bayesml.github.io/BayesML/bayesml.categorical.html "BayesML Categorical Model")
* [ポアソンモデル](https://bayesml.github.io/BayesML/bayesml.poisson.html "BayesML Poisson Model")
* [正規モデル](https://bayesml.github.io/BayesML/bayesml.normal.html "BayesML Normal Model")
* [多変量正規モデル](https://bayesml.github.io/BayesML/bayesml.multivariate_normal.html "BayesML Multivariate Normal Model")
* [指数モデル](https://bayesml.github.io/BayesML/bayesml.exponential.html "BayesML Exponential Model")
* [混合正規モデル](https://bayesml.github.io/BayesML/bayesml.gaussianmixture.html "BayesML Gaussian Mixture Model")
* [線形回帰モデル](https://bayesml.github.io/BayesML/bayesml.linearregression.html "BayesML Lenear Regression Model")
* [メタツリーモデル](https://bayesml.github.io/BayesML/bayesml.metatree.html "BayesML Meta-tree Model")
* [自己回帰モデル](https://bayesml.github.io/BayesML/bayesml.autoregressive.html "BayesML Autoregressive Model")
* [隠れマルコフモデル](https://bayesml.github.io/BayesML/bayesml.hiddenmarkovnormal.html "BayesML Hidden Markov Normal Model")
* [文脈木モデル](https://bayesml.github.io/BayesML/bayesml.contexttree.html "BayesML Context Tree Model")

また,今後はより複雑な階層的モデルを取り扱うパッケージを追加していく予定です.

Expand All @@ -134,8 +142,9 @@ BayesMLへのコントリビューションを考えてくださってありが

```
Y. Nakahara, N. Ichijo, K. Shimada, Y. Iikubo,
S. Saito, K. Kazama, T. Matsushima, BayesML Developers, ``BayesML 0.2.5,''
[Online] https://github.com/yuta-nakahara/BayesML
S. Saito, K. Kazama, T. Matsushima, BayesML Developers, ``BayesML,''
Python package version 0.3.0,
[Online] https://github.com/bayesml/BayesML
```

BibTeX
Expand All @@ -145,8 +154,9 @@ BibTeX
author = {Nakahara, Yuta and Ichijo, Naoki and Shimada, Koshi and
Iikubo, Yuji and Saito, Shota and Kazama, Koki and
Matsushima, Toshiyasu and {BayesML Developers}},
title = {BayesML 0.2.5},
howpublished = {\url{https://github.com/yuta-nakahara/BayesML}},
year = {2022}
title = {{BayesML}},
howpublished = {Python package version 0.3.0},
note = {\url{https://github.com/bayesml/BayesML}},
year = {2025}
}
```
2 changes: 1 addition & 1 deletion bayesml/_check.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Code Author
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
# Yuji Iikubo <yuji-iikubo.8@fuji.waseda.jp>
# Yasushi Esaki <esakiful@gmail.com>
# Jun Nishikawa <jun.b.nishikawa@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion bayesml/_exceptions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Code Author
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
class ParameterFormatError(Exception):
def __init__(self, value):
self.value = value
Expand Down
4 changes: 2 additions & 2 deletions bayesml/autoregressive/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Document Author
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Koki Kazama <kokikazama@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
# Koki Kazama <kazama@info.shonan-it.ac.jp>
r"""
The linear autoregressive model with the normal-gamma prior distribution.

Expand Down
4 changes: 2 additions & 2 deletions bayesml/autoregressive/_autoregressive.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Code Author
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
# Document Author
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
import warnings
import numpy as np
from scipy.stats import gamma as ss_gamma
Expand Down
2 changes: 1 addition & 1 deletion bayesml/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Code Author
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>

from abc import ABCMeta, abstractmethod
import pickle
Expand Down
4 changes: 2 additions & 2 deletions bayesml/bernoulli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Document Author
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Koki Kazama <kokikazama@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
# Koki Kazama <kazama@info.shonan-it.ac.jp>
r"""
The Bernoulli distribution with the beta prior distribution.

Expand Down
4 changes: 2 additions & 2 deletions bayesml/bernoulli/_bernoulli.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Code Author
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
# Document Author
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
import warnings
import numpy as np
from scipy.stats import beta as ss_beta
Expand Down
4 changes: 2 additions & 2 deletions bayesml/categorical/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Document Author
# Kohei Horinouchi <horinochi_18@toki.waseda.jp>
# Naoki Ichijo <1jonao@fuji.waseda.jp>
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Koki Kazama <kokikazama@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
# Koki Kazama <kazama@info.shonan-it.ac.jp>
r"""
The categorical distribution with the dirichlet prior distribution

Expand Down
4 changes: 2 additions & 2 deletions bayesml/categorical/_categorical.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Code Author
# Kohei Horinouchi <horinochi_18@toki.waseda.jp>
# Naoki Ichijo <1jonao@fuji.waseda.jp>
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
# Document Author
# Kohei Horinouchi <horinochi_18@toki.waseda.jp>
# Naoki Ichijo <1jonao@fuji.waseda.jp>
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
import warnings
import numpy as np
from scipy.stats import dirichlet as ss_dirichlet
Expand Down
4 changes: 2 additions & 2 deletions bayesml/contexttree/_contexttree.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Code Author
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
# Document Author
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
import warnings
import numpy as np
import matplotlib.pyplot as plt
Expand Down
4 changes: 2 additions & 2 deletions bayesml/exponential/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Document Author
# Koki Kazama <kokikazama@aoni.waseda.jp>
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Koki Kazama <kazama@info.shonan-it.ac.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
r"""
The exponential distribution with the gamma prior distribution.

Expand Down
4 changes: 2 additions & 2 deletions bayesml/exponential/_exponential.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# Luyu Ruan <zzstarsound@gmail.com>
# Koshi Shimada <shimada.koshi.re@gmail.com>
# Yuji Iikubo <yuji-iikubo.8@fuji.waseda.jp>
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
# Document Author
# Yuji Iikubo <yuji-iikubo.8@fuji.waseda.jp>
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
import warnings
import numpy as np
from scipy.stats import expon as ss_expon, gamma as ss_gamma, lomax as ss_lomax
Expand Down
2 changes: 1 addition & 1 deletion bayesml/gaussianmixture/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Document Author
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
# Naoki Ichijo <1jonao@fuji.waseda.jp>
r"""
The Gaussian mixture model with the Gauss-Wishart prior distribution and the Dirichlet prior distribution.
Expand Down
4 changes: 2 additions & 2 deletions bayesml/gaussianmixture/_gaussianmixture.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Code Author
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
# Document Author
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
import warnings
import numpy as np
from scipy.stats import multivariate_normal as ss_multivariate_normal
Expand Down
2 changes: 1 addition & 1 deletion bayesml/gaussianmixture/gaussianmixture.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- Document Author
Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
Yuta Nakahara <y.nakahara@waseda.jp>
Naoki Ichijo <1jonao@fuji.waseda.jp>
-->

Expand Down
2 changes: 1 addition & 1 deletion bayesml/hiddenmarkovnormal/_hiddenmarkovnormal.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Code Author
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
# Jun Nishikawa <jun.b.nishikawa@gmail.com>
from email import message
import warnings
Expand Down
4 changes: 2 additions & 2 deletions bayesml/linearregression/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Document Author
# Taisuke Ishiwatari <taisuke.ishiwatari@fuji.waseda.jp>
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Koki Kazama <kokikazama@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
# Koki Kazama <kazama@info.shonan-it.ac.jp>
r"""
The Baysian Linear Regression.

Expand Down
4 changes: 2 additions & 2 deletions bayesml/linearregression/_linearregression.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Code Author
# Taisuke Ishiwatari <taisuke.ishiwatari@fuji.waseda.jp>
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
# Document Author
# Taisuke Ishiwatari <taisuke.ishiwatari@fuji.waseda.jp>
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
import warnings
import numpy as np
from scipy.stats import gamma as ss_gamma
Expand Down
2 changes: 1 addition & 1 deletion bayesml/metatree/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Document Author
# Shota Saito <shota.s@gunma-u.ac.jp>
# Yuta Nakahara <yuta.nakahara@aoni.waseda.jp>
# Yuta Nakahara <y.nakahara@waseda.jp>
r"""
The stochastic data generative model is as follows:

Expand Down
Loading