当前位置:   article > 正文

决策树方法-对买电脑进行分类预测

决策树方法-对买电脑进行分类预测

用决策树方法对买电脑进行分类预测



  1. from sklearn.feature_extraction import DictVectorizer
  2. import csv
  3. from sklearn import preprocessing
  4. from sklearn import tree
  5. # from sklearn.externals.six import StringIO
  6. allElectronicsDate = open(r'E:\Python\practice\Decision_Tree\Class_buys_computer.csv','rt')
  7. reader = csv.reader(allElectronicsDate)#CSV模块自带的reader方法,可按行读取内容
  8. # print('reader:'+ str(reader))
  9. headers = next(reader)
  10. print(headers)
  11. featureList = []
  12. labelList = []
  13. for row in reade
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/寸_铁/article/detail/768677
推荐阅读
相关标签
  

闽ICP备14008679号