Giter VIP home page Giter VIP logo

id3-py's Introduction

#id3-py

id3 decision tree using python

Fork from https://github.com/arunaugustine/ID3

Maintain in

调用ID3算法的主函数是run.py中的 run_app。

###运行(支持python2.7, 3.x) python2 run.py train.dat test.dat python3 run.py train.dat test.dat 或者使用ori数据集 python2 run.py train-ori.dat test-ori.dat python3 run.py train-ori.dat test-ori.dat

###数据格式
create_decision_tree(examples, attributes, target_attribute, heuristic_funtion)

接受如下输入:

  1. examples (训练or测试数据集) : list of dicts (python字典)
  2. attributes : list
  3. target_attribute: string
  4. heuristic_funtion: 指向"gain"函数的函数指针

##NOTE:数据集文件最后一列为最终决定属性

  1. 数据集第一行为空格分行,并以2跟随在每个属性之后
    attr1 2 attr2 2 attr3 2 attr4 2 attr5 2 attr6 2 class 2
  2. 数据集数据部分全为tab(\t)分离
    1 1 0 0 0 0 0

id3-py's People

Contributors

whatot avatar

Stargazers

KC Chen avatar Joe avatar Casey Weed avatar Marcio Duarte avatar Jianping Zeng avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

ginking

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.