Giter Club home page Giter Club logo

decision-tree-id3's Introduction

Travis Status Coveralls Status CircleCI Status

decision-tree-id3

decision-tree-id3 is a module created to derive decision trees using the ID3 algorithm. It is written to be compatible with Scikit-learn's API using the guidelines for Scikit-learn-contrib. It is licensed under the 3-clause BSD license.

HTML Documentation - https://svaante.github.io/decision-tree-id3

Installation

Dependencies

  • Python (>= 2.7 or >= 3.3)
  • NumPy (>= 1.6.1)
  • Scikit-learn (>= 0.17)

The package by itself comes with a single estimator Id3Estimator. To install the module:

pip install decision-tree-id3

or clone the project using:

git clone https://github.com/svaante/decision-tree-id3.git
cd decision-tree-id3
python setup.py install

Usage

If the installation is successful, you should be able to execute the following in Python:

>>> from sklearn.datasets import load_breast_cancer
>>> from id3 import Id3Estimator
>>> from id3 import export_graphviz

>>> bunch = load_breast_cancer()
>>> estimator = Id3Estimator()
>>> estimator = estimator.fit(bunch.data, bunch.target)
>>> tree = export_graphviz(estimator.tree_, 'tree.dot', bunch.feature_names)

And to generate a PDF of the decision tree using GraphViz:

dot -Tpdf tree.dot -o tree.pdf

There are a number of different default parameters to control the growth of the tree: - max_depth, the max depth of the tree. -min_samples_split, the minimum number of samples in a split to be considered. - prune, if the tree should be post-pruned to avoid overfitting and cut down on size. - gain_ratio, if the algorithm should use gain ratio when splitting the data. - min_entropy_decrease, the minimum decrease in entropy to consider a split. - is_repeating, repeat the use of features.

For more in depth information see the documentation https://svaante.github.io/decision-tree-id3

decision-tree-id3's People

Contributors

onordander avatar svaante avatar vighneshbirodkar avatar mechcoder avatar nickynicolson avatar tomdlt avatar bryandeng avatar fabianp avatar arokem avatar kjacks21 avatar

Watchers

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