Skip to main content

Bayesian Additive Regression Models

Project description

BARMPy

text ignored, basic tests

text ignored, docs

text ignored, download count

HitCount to repo page

Intro

barmpy is the Python implementation of Baeysian Additive Regression Models, a generalization of BART, currently being researched [1]. We hope this library is useful for practictioners, enabling Bayesian architecture search and model ensembling.

Skeleton repo adapted from BartPy.

Check out the Tutorial

Quick Start

barmpy is on PyPi! Install the latest released version with pip install barmpy. barmpy also strives to be compatible with sklearn and easy-to-use. If you have arrays of target data, Y, and input data, X, you can quickly train a model and make predictions using it. barmpy currently supports ensembles of neural networks for both regression and binary classification. See below for simple examples.

from sklearn import datasets, metrics
from barmpy.barn import BARN, BARN_bin
import numpy as np

# Regression problem
db = datasets.load_diabetes()
model = BARN(num_nets=10,
          random_state=0,
          warm_start=True,
          solver='lbfgs',
		  l=1)
model.fit(db.data, db.target)
pred = model.predict(db.data)
print(metrics.r2_score(db.target, pred))

# Classification problem
bc = datasets.load_breast_cancer()
bmodel = BARN_bin(num_nets=10,
          random_state=0,
          warm_start=True,
          solver='lbfgs',
		  l=1)
bmodel.fit(bc.data, bc.target)
pred = bmodel.predict(bc.data)
print(metrics.classification_report(bc.target, np.round(pred)))

References

[1] https://arxiv.org/abs/2404.04425

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

barmpy-1.2.3.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

barmpy-1.2.3-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file barmpy-1.2.3.tar.gz.

File metadata

  • Download URL: barmpy-1.2.3.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for barmpy-1.2.3.tar.gz
Algorithm Hash digest
SHA256 57285cce25652bbfaf7fbf7846c1bca7c9b4bb399cab30f1dddedf41f614076f
MD5 b0b485026bc9eb0a9bc9056384c7b826
BLAKE2b-256 6d1d679bda06a6464d307d07c459d0335e93b17f3ecf932034a80c47a84a7ca8

See more details on using hashes here.

File details

Details for the file barmpy-1.2.3-py3-none-any.whl.

File metadata

  • Download URL: barmpy-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for barmpy-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 34de984ce1e26033310114dd0b0e107ae78674f23625cc397ed274b25364f597
MD5 d3c2d4c03db3a9709dcaf12c9c452de9
BLAKE2b-256 11729e0a9dc400c3d51ed2e0ccd684ffd54e0e9f0709a0dcf6ad305644717914

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page