Coder Social home page Coder Social logo

asforests's Introduction

asforests

Automatically Stopping Random Forests - an sklearn extension

Why to use?

Never worry again about the number of trees you should use in the forest: Standard Random Forest implementations like in sklearn require a hyperparameter for the number of trees. However, this number can be determined automatically online analyzing the performance curve of the forest. This is what asforests do.

Implementations in asforests inherit from the forests in scikit-learn, so they can be used exactly in the same way, except that you do not (cannot) specify the number of trees.

Usage

Installation

pip install asforests

Example Code

from asforests import RandomForestClassifier
rf = RandomForestClassifier()

To test this with some dataset:

import sklearn.model_selection
import sklearn.datasets
X, y = sklearn.datasets.load_iris(return_X_y = True)
sklearn.model_selection.cross_validate(rf, X, y)

Remarks

  • The RandomForestClassifier in asforests supports all the hyperparameters of the standard RandomForestClassifier from scikit-learn, with the same sematics.
  • Currently, the forest internally uses a validation fold to build the learning curve. This can imply that the performance of the RF is slightly worse that the one of the standard RF, because less instances are used for training. This will be replaced in a future version by the OOB estimate.

asforests's People

Contributors

fmohr avatar

Watchers

 avatar

asforests's Issues

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.