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.0.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

barmpy-1.2.0-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for barmpy-1.2.0.tar.gz
Algorithm Hash digest
SHA256 3f4b38ed2d1c332e4052b9afb1e11f41f06e373fabb47945fdb2aa770e286560
MD5 00625b7ce38ac024ee03f147c43784e0
BLAKE2b-256 9e5f082d673089c0c403052d35096d2c3f092b5553f55dbca7199300e624fba0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for barmpy-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b886cd313872faf1b00bf26673ecc455df0328d33b1c1c4d0edc275f06917f70
MD5 2524e572fc6d5e70080ef152e13de89f
BLAKE2b-256 7cc582e1f7198fb10bddbf58b926e8b13ec40bcb7f47be42d3cb5c4934897fb4

See more details on using hashes here.

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