资源简介

《机器学习实战》中决策树python2.7代码经过加工修改后在python3.0可以完美运行的代码

资源截图

代码片段和文件信息

# def createDataSet():
#     dataSet = [[110‘maybe‘]
#                [1 10‘yes‘]
#                [1 1 1‘yes‘]
#                [101‘maybe‘]
#                [010‘no‘]
#                [010‘no‘]]
#     labels = [‘no surfacing‘‘flippers‘‘maybe‘]
#     return dataSetlabels
def createDataSet():
    dataSet = [[1 1 ‘yes‘]
               [1 1 ‘yes‘]
               [1 0 ‘no‘]
               [0 1 ‘no‘]
               [0 1 ‘no‘]]
    labels = [‘no surfacing‘‘flippers‘]
    #change to discrete values
    return dataSet labels

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-08-12 15:40  Tree\
     目录           0  2017-12-02 20:36  Tree\.idea\
     文件         459  2017-08-08 14:15  Tree\.idea\Tree.iml
     目录           0  2017-08-08 14:15  Tree\.idea\dictionaries\
     文件          90  2017-08-08 14:15  Tree\.idea\dictionaries\.xml
     目录           0  2017-08-08 14:08  Tree\.idea\inspectionProfiles\
     文件         228  2017-08-08 14:08  Tree\.idea\inspectionProfiles\profiles_settings.xml
     文件         212  2017-08-08 14:15  Tree\.idea\misc.xml
     文件         260  2017-08-08 14:08  Tree\.idea\modules.xml
     文件       44128  2017-12-02 20:36  Tree\.idea\workspace.xml
     文件         582  2017-08-09 15:47  Tree\CreateDataSet.py
     文件         514  2017-08-09 17:20  Tree\Store.py
     目录           0  2017-08-09 17:21  Tree\__pycache__\
     文件         407  2017-08-09 16:09  Tree\__pycache__\CreateDataSet.cpython-35.pyc
     文件         375  2017-08-09 15:48  Tree\__pycache__\CreateDataSet.cpython-36.pyc
     文件         523  2017-08-09 17:21  Tree\__pycache__\Store.cpython-35.pyc
     文件        3457  2017-08-09 16:09  Tree\__pycache__\treePlotter.cpython-35.pyc
     文件        3088  2017-08-09 15:48  Tree\__pycache__\treePlotter.cpython-36.pyc
     文件        3082  2017-08-09 17:05  Tree\__pycache__\trees.cpython-35.pyc
     文件        2803  2017-08-09 16:06  Tree\__pycache__\trees.cpython-36.pyc
     文件          84  2017-08-09 17:08  Tree\classifierStorage.txt
     文件         795  2012-01-09 21:40  Tree\lenses.txt
     文件         783  2017-08-12 15:40  Tree\test.py
     文件        4079  2017-08-09 15:46  Tree\treePlotter.py
     文件        4642  2017-08-09 16:30  Tree\trees.py

评论

共有 条评论