GithubHelp home page GithubHelp logo

sachinbiradar9 / decision-tree-learning Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 7.0 20 KB

Implementation of Decision tree learning algorithm with chi-square pruning

License: GNU General Public License v3.0

Python 100.00%
decision-tree-learning decision-tree-classifier decision-tree entropy information-gain chi-square pruning

decision-tree-learning's Introduction

Decision Tree Learning

The Decision Tree Learning algorithm adopts a greedy divide-and-conquer strategy: always test the most important attribute first. This test divides the problem up into smaller subproblems that can then be solved recursively. By β€œmost important attribute,” we mean the one that makes the most difference to the classification of an example. That way, we hope to get to the correct classification with a small number of tests, meaning that all paths in the tree will be short and the tree as a whole will be shallow.

On some problems, the Decision Tree Learning algorithm will generate a large tree when there is actually no pattern to be found. This problem is called overfitting. A technique called decision tree pruning combats overfitting. Pruning works by eliminating nodes that are not clearly relevant. We start with a full tree, as generated by Decision Tree Learning. We then look at a test node that has only leaf nodes as descendants. If the test appears to be irrelevant detecting only noise in the data then we eliminate the test, replacing it with a leaf node. We repeat this process, considering each test with only leaf descendants, until each one has either been pruned or accepted as is. In this project we use chi-square to test irrelevance of attribute

Usage

python decision.py file_name alpha

file_name contains tagged data

alpha is used for chi-square pruning

decision-tree-learning's People

Contributors

sachinbiradar9 avatar

Stargazers

 avatar  avatar

Watchers

 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.