Coder Social home page Coder Social logo

ahmedhghareeb / bartmachine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kapelner/bartmachine

0.0 2.0 0.0 22.21 MB

An R-Java Bayesian Additive Regression Trees implementation

License: MIT License

R 13.63% Java 22.16% TeX 0.47% HTML 63.11% CSS 0.63%

bartmachine's Introduction

bartMachine

An R-Java Bayesian Additive Regression Trees implementation (BART) Software for Supervised Statistical Learning

Copyright (C) 2016 Adam Kapelner
Department of Mathematics, Queens College, City University of New York & Justin Bleich Department of Statistics, The Wharton School of the University of Pennsylvania

This is a Java implementation of the algorithm found in Chipman, George, & McCulloch BART: Bayesian Additive Regressive Trees. The Annals of Applied Statistics. 2010 4(1): 266-298 as well as many other features.

The Paper

For a vignette describing the BART model and bartMachine's features, see our vignette which is also on arXiv and is currently being reviewed by the Journal of Statistical Software.

The Manual

See the manual for detailed information about the package's functions and parameters.

Setup Instructions

To install the bartMachine package in R, you first need to install Java and rJava and configure your computer, then you can install the package from CRAN or compile from source.

Install Java JDK (not the JRE)

Download the latest Java JDK and install it properly (Java7 or above required). rJava requires the JDK; you cannot just have a JRE.

Install rJava

Use install.packages("rJava") within R. If you experience errors, make sure your JAVA_HOME system variable is set to the root of your java installation (on a windows machine that would look something like C:\Program Files\Java\jdk1.7.0_09). Also try running R CMD javareconf from the command line. On ubuntu, you should run sudo apt-get install r-cran-rjava to install from the command prompt. If you still have errors, google your error message. There are many people who have had problems with the rJava installation in the past and the majority of issues have been resolved on forums.

Install bartMachine via CRAN

Use install.packages("bartMachine") within R and then options(java.parameters = "-Xmx2500m") to set a larger amount of RAM than the default of 500MB and then library(bartMachine).

Install bartMachine via compilation from source

This is recommended as you will get the benefits of Java 7 as well as the latest release of the software (see changelog).

  1. Make sure you have git properly installed.

  2. Run git clone https://github.com/kapelner/bartMachine.git from your command line and navigate into the cloned project directory via cd bartMachine.

  3. Make sure you have a Java JDK installed properly. Then make sure the bin directory is an element in the PATH variable (on a windows machine it would look something like C:\Program Files\Java\jdk1.7.0_09\bin).

  4. Make sure you have apache ant installed properly. Make sure you add the bin directory for ant to your system PATH variable (on a windows machine it would be something like C:\Program Files\apache-ant-1.8.4\bin). We also recommend making a system variable ANT_HOME which would be set to the root of ant (on a windows machine it would be something like C:\Program Files\apache-ant-1.8.4). Also, double check the JAVA_HOME variable to make sure it points to the JDK

  5. Compile the JAVA source code into a JAR using ant. You should see a compilation record and then BUILD SUCCESSFUL and a total time.

  6. Now you can install the package into R using R CMD INSTALL bartMachine. On Windows systems, this may fail because it expects multiple architectures. This can be corrected by running R CMD INSTALL --no-multiarch bartMachine. This may also fail if you don't have the required packages installed (run install.packages("car") and install.packages("missForest")). Upon successful installation, the last line of the output should read DONE (bartMachine). In R, you can now run library(bartMachine) and start using the package normally.

Acknowledgements

We thank Ed George, Abba Krieger, Shene Jensen and Richard Berk for helpful discussions. We thank Matt Olson for pointing out an important memory issue. We thank JProfiler for profiling the code which allowed us to create a lean implementation.

bartmachine's People

Contributors

kapelner avatar jbleich89 avatar moserware avatar

Watchers

James Cloos avatar Ahmed Ghareeb avatar

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.