机器学习(七) — 决策树

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
相关推荐
kay_5454 分钟前
YOLO26改进| 特征融合 | 小波变换的多尺度特征融合
人工智能·目标检测·计算机视觉·目标跟踪·论文·yolo26·yolo26改进
木心术110 分钟前
如何使用AI agent基于产品技术手册和标准协议完成FPGA寄存器的自动化配置、代码修改和编译的完整方案
人工智能·fpga开发·自动化
暗夜猎手-大魔王10 分钟前
转载--AI Agent 架构设计:工具调用失败了怎么办——重试、换方案、还是报告(OpenClaw、Claude Code、Hermes Agent 对比)
人工智能
Deepoch18 分钟前
面向工业现场自主运维:Deepoc 具身模型开发板的端侧智能升级路径
运维·人工智能·科技·巡检机器人·deepoc
科技牛牛23 分钟前
AI爬虫引爆代理IP产业:一场正在发生的数据粮草争夺战
人工智能·爬虫·tcp/ip·数据安全·ip地址查询
涤生大数据44 分钟前
AI时代,SQL该何去何从?
数据库·人工智能·sql
冬奇Lab1 小时前
RAG 系列(十一):Rerank——让检索结果按重要性排队
人工智能·llm·源码
冬奇Lab1 小时前
一天一个开源项目(第96篇):OpenHarness - 轻量级 AI 代理基础设施框架
人工智能·开源·资讯
lulu12165440781 小时前
JetBrains IDE 终极AI编程方案:CC GUI插件让Claude Code和Codex丝滑运行
java·ide·人工智能·python·ai编程
啦啦啦_99992 小时前
案例之 逻辑回归_电信用户流失预测
算法·机器学习·逻辑回归