机器学习(七) — 决策树

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
相关推荐
极客猴子几秒前
AI会议记录工具横评:科会通、通义听悟、飞书妙记的自动整理效果有什么区别?
人工智能·飞书
Web3_Daisy3 分钟前
如何在Robinhood Chain创建 Uniswap V3 流动性池
大数据·人工智能·web3·区块链
西安小哥5 分钟前
深度融合与价值重构:人工智能与未来社会的全景演进
人工智能·重构
Access开发易登软件6 分钟前
Access 怎么做前后端分离?用 Web API 读写 SQL Server
前端·数据库·人工智能·microsoft·excel·access
Juicedata10 分钟前
腾讯云 x JuiceFS:基于 FoundationDB 的企业级统一存储实践
数据库·人工智能·科技·云计算·腾讯云
问商十三载17 分钟前
RAG 检索召回越多越好?2026 信噪比模型深度解析
人工智能·算法·机器学习
在学了加油26 分钟前
LSTM-糖尿病探索与预测
人工智能·rnn·lstm
长三角活动观察28 分钟前
政企线下活动全流程项目管控方案:苏州独石传媒长三角多场景落地实践总结
大数据·人工智能·传媒
正在走向自律29 分钟前
AI 辅助研发内部复盘(2/5):老项目改造的工程化实践
人工智能·ai编程·代码规范·ai辅助编程·老代码改造
煎饼学大模型34 分钟前
从 Harness 工程到 Loop 工程落地实践
人工智能·大模型·harness