首页 > TAG信息列表 > secondDict

Machine Learning in Action 读书笔记---第3章 决策树

Machine Learning in Action 读书笔记 第3章 决策树 文章目录 Machine Learning in Action 读书笔记一、决策树算法简介1 决策树的构造2 决策树的一般流程 二、决策树的构造过程1. 划分数据集2.递归构建决策树3.在python中使用matplotlib注解绘制树形图4.判断是否鱼类实例

决策树——C4.5

-- coding: utf-8 -- """ Created on Thu Aug 2 17:09:34 2018 决策树ID3,C4.5的实现 @author: weixw """ from math import log import operator 原始数据 def createDataSet(): dataSet = [[0, 0, 0, 0, 'no'], [0, 0, 0, 1, 'no']

学渣也学ML:决策树之笔记二

使用决策树执行分类 函数功能:对一个测试实例进行分类 参数说明: inputTree:已经生成的决策树 labels:存储选择的最优特征标签 testVec:测试数据列表,顺序对应原数据集 返回: classLabel:分类结果 def classify(inputTree,labels, testVec): firstStr = next(iter(inputTree