Skip to content

JieweiWei/Decision-Tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Decision-Tree

使用决策树对数据集进行分类

##开发平台

Ubuntu Kylin 14.04

##运行程序

在终端进入项目目录,输入:

$ make -- 编译程序

$ ./main -- 运行程序

$ ./main test -- 计算决策树的准确率

##输入输出说明

data/dataset.txt -- 决策树的数据集合,前100条记录用于训练模型,后面的数据用于预测并验证

data/correctResult.txt -- 数据的真实结果

data/predictions.txt -- 决策树的预测结果

##数据集描述

  1. Title: 1984 United States Congressional Voting Records Database

  2. Source Information: (a) Source: Congressional Quarterly Almanac, 98th Congress, 2nd session 1984, Volume XL: Congressional Quarterly Inc. Washington, D.C., 1985. (b) Donor: Jeff Schlimmer (Jeffrey.Schlimmer@a.gp.cs.cmu.edu) (c) Date: 27 April 1987

  3. Past Usage

    • Publications
      1. Schlimmer, J. C. (1987). Concept acquisition through representational adjustment. Doctoral dissertation, Department of Information and Computer Science, University of California, Irvine, CA. -- Results: about 90%-95% accuracy appears to be STAGGER's asymptote
      • Predicted attribute: party affiliation (2 classes)
  4. Relevant Information: This data set includes votes for each of the U.S. House of Representatives Congressmen on the 16 key votes identified by the CQA. The CQA lists nine different types of votes: voted for, paired for, and announced for (these three simplified to yea), voted against, paired against, and announced against (these three simplified to nay), voted present, voted present to avoid conflict of interest, and did not vote or otherwise make a position known (these three simplified to an unknown disposition).

  5. Number of Instances: 435 (267 democrats, 168 republicans)

  6. Number of Attributes: 16 + class name = 17 (all Boolean valued)

  7. Attribute Information:

    1. Class Name: 2 (democrat, republican)
    2. handicapped-infants: 2 (y,n)
    3. water-project-cost-sharing: 2 (y,n)
    4. adoption-of-the-budget-resolution: 2 (y,n)
    5. physician-fee-freeze: 2 (y,n)
    6. el-salvador-aid: 2 (y,n)
    7. religious-groups-in-schools: 2 (y,n)
    8. anti-satellite-test-ban: 2 (y,n)
    9. aid-to-nicaraguan-contras: 2 (y,n)
  8. mx-missile: 2 (y,n)

  9. immigration: 2 (y,n)

  10. synfuels-corporation-cutback: 2 (y,n)

  11. education-spending: 2 (y,n)

  12. superfund-right-to-sue: 2 (y,n)

  13. crime: 2 (y,n)

  14. duty-free-exports: 2 (y,n)

  15. export-administration-act-south-africa: 2 (y,n)

  16. Missing Attribute Values: Denoted by "?"

    NOTE: It is important to recognize that "?" in this database does not mean that the value of the attribute is unknown. It means simply, that the value is not "yea" or "nay" (see "Relevant Information" section above).

    Attribute: #Missing Values: 1: 0 2: 0 3: 12 4: 48 5: 11 6: 11 7: 15 8: 11 9: 14 10: 15 11: 22 12: 7 13: 21 14: 31 15: 25 16: 17 17: 28

  17. Class Distribution: (2 classes)

    1. 45.2 percent are democrat
    2. 54.8 percent are republican

About

使用决策树对数据集进行分类

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors