Code Monkey home page Code Monkey logo

barmpy's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.