Giter Site home page Giter Site logo

randomforest-python's Introduction

Random Forests in Python

This module is a basic implementation of Random Forests which allows users to define their own weak learners (the tests performed at each node). It was written as a prototype for a C++ version with templates. It is slow, but pure Python and easy to play with. People looking for a Python Random Forest usable in real problems should start with scikit-learn.

It is written for Python 3.

Classification example

These examples train on three spiral (without noise) and predict the whole plane. They try 4 different weak learners: axis aligned, linear, conic and parabolas.

python example_classification.py

Using one single tree:

Axis aligned:

Linear:

Conic:

Parabola:

Using a forest of 10 trees, with soft or hard decision boundaries:

Axis aligned:
 

Linear:
 

Conic:
 

Parabola:
 

Regression example

These examples train on two circles and predict the center of the bottom right quadrant (predicting the center of the image would be too easy!). They try 4 different weak learners: axis aligned, linear, conic and parabolas.

python example_regression.py

Using one single tree:

Axis aligned:

Linear:

Conic:

Parabola:

Using a forest of 10 trees

Axis aligned:

Linear:

Conic:

Parabola:

Reference

A. Criminisi, J. Shotton, and E. Konukoglu, "Decision Forests for Classification, Regression, Density Estimation, Manifold Learning and Semi-Supervised Learning", no. MSR-TR-2011-114, 28 October 2011.
http://research.microsoft.com/en-us/projects/decisionforests/

randomforest-python's People

Contributors

kevin-keraudren avatar

Watchers

James Cloos 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.