Code Monkey home page Code Monkey logo

ranger's Introduction

Travis Build Status AppVeyor Build Status Coverage Status CRAN Downloads month CRAN Downloads overall

ranger: A Fast Implementation of Random Forests

Marvin N. Wright

Introduction

ranger is a fast implementation of random forests (Breiman 2001) or recursive partitioning, particularly suited for high dimensional data. Classification, regression, and survival forests are supported. Classification and regression forests are implemented as in the original Random Forest (Breiman 2001), survival forests as in Random Survival Forests (Ishwaran et al. 2008). Includes implementations of extremely randomized trees (Geurts et al. 2006) and quantile regression forests (Meinshausen 2006).

ranger is written in C++, but a version for R is available, too. We recommend to use the R version. It is easy to install and use and the results are readily available for further analysis. The R version is as fast as the standalone C++ version.

Installation

R version

To install the ranger R package from CRAN, just run

install.packages("ranger")

R version >= 3.1 is required. With recent R versions, multithreading on Windows platforms should just work. If you compile yourself, the new RTools toolchain is required.

To install the development version from GitHub using devtools, run

devtools::install_github("imbs-hl/ranger")

Standalone C++ version

To install the C++ version of ranger in Linux or Mac OS X you will need a compiler supporting C++11 (i.e. gcc >= 4.7 or Clang >= 3.0) and Cmake. To build start a terminal from the ranger main directory and run the following commands

cd cpp_version
mkdir build
cd build
cmake ..
make

After compilation there should be an executable called "ranger" in the build directory.

To run the C++ version in Microsoft Windows please cross compile or ask for a binary.

Usage

R version

For usage of the R version see ?ranger in R. Most importantly, see the Examples section. As a first example you could try

ranger(Species ~ ., data = iris)

Standalone C++ version

In the C++ version type

./ranger --help 

for a list of commands. First you need a training dataset in a file. This file should contain one header line with variable names and one line with variable values per sample (numeric only). Variable names must not contain any whitespace, comma or semicolon. Values can be seperated by whitespace, comma or semicolon but can not be mixed in one file. A typical call of ranger would be for example

./ranger --verbose --file data.dat --depvarname Species --treetype 1 --ntree 1000 --nthreads 4

If you find any bugs, or if you experience any crashes, please report to us. If you have any questions just ask, we won't bite.

Please cite our paper if you use ranger.

References

ranger's People

Contributors

0x7f avatar ben519 avatar bfgray3 avatar edoffagne avatar gregordecillia avatar ironholds avatar jtibshirani avatar katrinleinweber avatar kirillseva avatar krlmlr avatar kysolvik avatar mnwright avatar rnowling avatar

Watchers

 avatar  avatar  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.