机器学习(七) — 决策树

model 4 --- decision tree

1 decision tree

1. component

usage: classification

  1. root node
  2. decision node

2. choose feature on each node

maximize purity (minimize inpurity)

3. stop splitting

  1. a node is 100% on class
  2. splitting a node will result in the tree exceeding a maximum depth
  3. improvement in purity score are below a threshold
  4. number of examples in a node is below a threshold

2 meature of impurity

use entropy( H H H) as a meature of impurity

H ( p ) = − p l o g 2 ( p ) − ( 1 − p ) l o g 2 ( 1 − p ) n o t e : 0 l o g 0 = 0 H(p) = -plog_2(p) - (1-p)log_2(1-p)\\ note: 0log0 = 0 H(p)=−plog2(p)−(1−p)log2(1−p)note:0log0=0

3 information gain

1. definition

i n f o m a t i o n _ g a i n = H ( p r o o t ) − ( w l e f t H ( p l e f t ) + w r i g h t H ( p r i g h t ) ) infomation\_gain = H(p^{root}) - (w^{left}H(p^{left}) + w^{right}H(p^{right})) infomation_gain=H(proot)−(wleftH(pleft)+wrightH(pright))

2. usage

  1. meature the reduction in entropy
  2. a signal of stopping splitting

3. continuous

find the threshold that has the most infomation gain

4 random forest

  1. generating a tree sample
复制代码
given training set of size m
for b = 1 to B:
	use sampling with replacement to create a new training set of size m
	train a decision tree on the training set
  1. randomizing the feature choice: at each node, when choosing a feature to use to split, if n features is available, pick a random subset of k < n(usually k = n k = \sqrt{n} k=n ) features and alow the algorithm to only choose from that subset of features
相关推荐
在所不辞兄6 小时前
【零基础学智能仿真-53】多智能体协作——有限元自动化实战从工程需求到可审核的仿真报告
人工智能·深度学习·神经网络·机器学习·有限元
AI Coder 码农王8 小时前
AgentScope Java v2 第3课,从 ReActAgent 到 HarnessAgent
人工智能
格物致胜工业数智技术8 小时前
明治EOS系列传感器技术解析:精密制造高反光金属件在位检测
人工智能·制造
甲维斯8 小时前
DeepSeek 新版还是难评!
人工智能
晨间晓8 小时前
图片细节丰富不丰富?用华为云码道开发 OpenCV 纹理复杂度分析工具
人工智能·opencv·华为云
硅谷秋水8 小时前
面向机器人的上下文学习:方法与应用
深度学习·机器学习·语言模型·机器人
2603_965148119 小时前
电商选品调研:通过关键词搜索API获取市场热销商品,结合商品详情API分析竞品卖点与定价
开发语言·数据库·人工智能·python·信息可视化
镜象科技9 小时前
什么是好的校园AI心理健康解决方案服务商?从中外校园心理服务的一天说起
人工智能
Geeys9 小时前
拼多多单品推广完整方案(可直接落地)
大数据·人工智能
泡椒鸡脚9 小时前
AI室内设计风格融合:把布局、材质和光影参考分开写
人工智能·材质