机器学习(七) — 决策树

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
相关推荐
Eyfcom42 分钟前
〖物流数据安全 02〗差分隐私与同态加密的工程边界:跨境物流快递系统该为隐私付出多少计算代价?
算法·机器学习·同态加密·跨境物流快递系统·物流数据安全
Wellijohn1 小时前
别急着上框架:300 行写一个生产可用的 Agent 循环
人工智能·llm·agent
wuyk5552 小时前
AI 时代的嵌入式该怎么学-09-嵌入式vs后端vs算法
人工智能·stm32·单片机·嵌入式硬件·mcu·物联网·算法
小酒星小杜3 小时前
老师你也没想到吧,当年坐在最后一排的学生现在可以用AI做游戏了
人工智能·产品·全栈
hpoenixf4 小时前
从命令行到研究工作台:让一份研究下次还能接着做
人工智能
硅谷秋水5 小时前
迈向物理层面的RSI:人形机器人“身体-控制”协同设计
人工智能·机器学习·语言模型·机器人
阿宝哥5 小时前
2027工程保养企业10大ERP选型参考:主流厂商对比与优缺点分析
人工智能
QXWZ_IA6 小时前
道路巡检用边缘计算好还是云端处理好:跟着一帧图像走一遍
人工智能·边缘计算
硅谷秋水7 小时前
RoboKit:加速机器人学习中的并行可微分优化
人工智能·机器学习·语言模型·机器人