Git Product home page Git Product logo

data_mining's Introduction

数据挖掘第一次大作业——决策树

利用C4.5算法生成决策树,仅针对二分类问题

其中决策树停止条件

1.信息增益小于0.1

2.没有多余的属性

程序输入输出

输入格式.csv文件,输出使用决策树预测结果的准确率(仅当前训练集)

测试集

训练的测试集使用了sample.csv和play_golf.csv

年龄 有工作 有自己的房子 信贷情况 类别
青年 一般 0
青年 0
青年 1
青年 一般 1
青年 一般 0
中年 一般 0
中年 0
中年 1
中年 非常好 1
中年 非常好 1
老年 非常好 1
老年 1
老年 1
老年 非常好 1
老年 一般 0

sample.csv 该数据集来自 《统计学习方法》李航

Outlook Temperature Humidity Windy Play Golf?
Rainy Hot High FALSE No
Rainy Hot High TRUE No
Overcast Hot High FALSE Yes
Sunny Mild High FALSE Yes
Sunny Cool Normal FALSE Yes
Sunny Cool Normal TRUE No
Overcast Cool Normal TRUE Yes
Rainy Mild High FALSE No
Rainy Cool Normal FALSE Yes
Sunny Mild Normal FALSE Yes
Rainy Mild Normal TRUE Yes
Overcast Mild High TRUE Yes
Overcast Hot Normal FALSE Yes
Sunny Mild High TRUE No

Play_golf.csv 该数据集来自于University of Toronto data-mining 的讲义

测试结果

对两例测试准确率均为1

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.