Giter Site home page Giter Site logo

decision-tree's Introduction

Classification using Decision Tree From Scratch

Introduction

Classifying letter recognition data based on ID3 Algorithm using Decision Tree and got the confusion matrix.

  • First part

The tree is trained based on Information Gain (IG) criterion.

  • Second part

The tree is trained based on Gini Index criterion.

  • Third part

The two attributes with the most IG are swapped and the tree is trained.

  • Fourth part

Using Random Forest, clustered the attributes into K folds, and trained K trees and found the K with the best accuracy.

Implemented by two approaches, one using cells(memory consuming), and the other, using nested queries. Details in the code!

Datasets

The Dataset is a mat file, which can be easily read using loadmat command in MATLAB. It includes 4000 test, and 16000 training handwritten black-white alphabet letters, totally in 26 classes. Each instance has 16 features, such as number of different pixels, mean and variance of the balck pixels in different ways and etc.

Description of the files in this repository

  1. code/initial_tree.m: Execute this file to train the Decision Tree based on IG.
  2. code/initial_tree_GINI.m: Execute this file to train the Decision Tree based on Gini index.
  3. code/tree_changed_atts.m: For the 3rd part
  4. code/random_forest.m: Contains the 4th part.

decision-tree's People

Contributors

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