Introduction to Boosted Trees

XGBoost详解(原理篇) XGBoost全称为eXtreme Gradient Boosting,即极致梯度提升树。XGBoost是Boosting算法的其中一种,Boosting算法的思想是将许多弱分类器集成在一起,形成一个强分类器(个体学习器间存在强依赖关系,必须串行生成的序列化方法)。Note:关于Boosting算法详见博文集成学习详解_tt丫的博客-优快云博客XGBoost是一种提升树模型,即它将许多树模型集成在一起,形成一个很强的分类器。其中所用到的树模型则是CART回归树模型。 阅读详情

Review of concepts of supervised learning

objective function

Obj(Θ)=L(Θ)+Ω(Θ)(2.1)

where L(Θ) is the training loss,and Ω(Θ) is regularization which measures the complexity of model.

loss function L(Θ)

  • square loss: l(yi,ŷ i)=∥yi−ŷ i∥2
  • logistic loss: l(yi,ŷ i)=yiln(1+e−ŷ i)+ŷ iln(1+e−yi)

regularization Ω(Θ)

  • l1 norm (lasso): Ω(w)=λ∥w∥1
  • l2 norm (ridge): Ω(w)=λ∥w∥22

lasso

∑i=1n∥yi−ŷ i∥2+λ∥w∥22

- linear model,square loss,l1 regularition

ridge regression

∑i=1n∥yi−ŷ i∥2+λ∥w∥22

- linear model,square loss,l2 regularition

logistic regression

∑i=1n[yiln(1+e−ŷ i)+ŷ iln(1+e−yi)]+λ∥w∥22

- linear model, logistic loss,l2 regulation

boosted trees

Regression tree(CART)

regression tree, or classification and regression tree,contains one score in each leaf value.
这里写图片描述

Regression tree ensemble

prediction of each menber is sum of scores predicted by each of the tree
这里写图片描述

tree ensemble methods

  • mostly widely used ,such as GBM,random forest …
  • invariante to scaling of inputs,so needn’t worry about feature normalization
  • learn higehr order interaction between features

represent the RT in optimization method

  • model: assuming we have K trees

    ŷ i=∑k=1Kfk(xi),fk(x)∈F

    • F is space of functions containing all regression trees.
    • regression tree is a function that maps the attitute to the score.
    • each regression tree fk(x) is in charge of some parts of the attributes.
  • Parametres: struction of each tree fk(x) ,and the score in the leaf
    or simply Θ={f1,…,fK}

  • Objective

    Obj(Θ)=∑i=1nl(yi,ŷ i)+∑k=1KΩ(fk)(2.3)

  • how to define to define Ω ?
    • # nodes/depth
    • l2 norm of the leaf weights
    • ….
  • how to define loss function
    • square loss result in common gradient boosted machine
    • logistic loss result in logitBoost

how to solve the optimization problem

additive training (boosting)

at training round 0,start from constant prediction, add a new function each time:
ŷ (0)i=0
ŷ (1)i=f1(xi)=ŷ (0)i+f1(xi)
ŷ (2)i=f1(xi)+f2(xi)=ŷ (1)i+f2(xi)
…
at traing round t,Keep functions added in previous round( ŷ (k−1)i ) and add a new function fk(xi) :
ŷ (t)i=∑k=1tfk(xi)=ŷ (k−1)i+fk(xi)

how we decide which f to add?

at round t,solve the optimization:

minftObj(t)=∑i=1nl(yi,ŷ (t−1)i+ft(xi))+∑i=1tΩ(fi)=∑i=1nl(yi,ŷ (t−1)i+ft(xi))+Ω(ft)+C(2.3)

for lose function:

  • square loss: Obj(t) becomes a quadratic function of ft , let the derivetive be 0 then…
  • other cases ,we can use the numeric ways:
    • define gi=∂ŷ (t−1)l(yi,ŷ (t−1)i) , hi=∂2ŷ (t−1)l(yi,ŷ (t−1)i)
    • the taylor expansion of Obj(t) :
      Obj(t)≈∑i=1n[l(yi,ŷ (t−1)i)+gift(xi)+12h2ift(xi)]+Ω(ft)+C
    • with constants removed, Obj(t) becomes:
      ∑i=1n[gift(xi)+12h2ift(xi)]+Ω(ft)

so again we retain to a quadratic convex optimization.

how to define F: the space of functions containing all regression trees

map concept of tree to optimization

information gain -> train loss
pruning->regularization defined be #nodes
max depth -> constraint on the function space
smoothing leaf values -> l2 regularization on leaf weights

refine the definition of tree

  • We define tree by a vector of scores in leafs, and a leaf index mapping function q(x) that maps an instance to a leaf
    ft(x)=wq(x),w∈RT,q:Rd→{1,2,…,T}

    • T is # leaf
    • q(x) means that sample falls into which leaf,such as 1,3
    • wy means the weight of leaf y

这里写图片描述

Define the Complexity of Tree

  • Define complexity as (this is not the only possible definition)
    Ω(ft)=γT+12λ∑j=1Tw2j

这里写图片描述

revisit the instance set in leaf j as

  • Define the instance set in leaf j as
    Ij={i|q(xi)=j}
  • Regroup the objective by each leaf
    Obj(t)≈∑i=1n[gift(xi)+12h2ift(xi)]+Ω(ft)=∑i=1n[gift(xi)+12h2ift(xi)]+γT+12λ∑j=1Tw2j=∑j=1T[∑i∈Ijgiwj+12(∑i∈Ijhi+λ)w2j]+γT

    • This is sum of T independent quadratic functions

The structure score

Two facts about single variable quadratic function:

argminxGx+12Hx2⟺x=−GH,minxGx+12Hx2=−G22H

define Gj=∑i∈Ijgj,Hj=∑i∈Ijhj ,then objective becomes
Obj(t)=∑j=1T[∑i∈Ijgiwj+12(∑i∈Ijhi+λ)w2j]+γT=∑j=1T[Giwj+12(Hj+λ)w2j]+γT

  • Assume the structure of tree q(x) is fixed, the optimal weight in each leaf, and the resulting objective value are:
    w∗j=−GjHj+λ
  • then objective becomes:
    Obj=−12∑j=1TG2jHj+λ+γT

EXAMPLE

here comes the example

这里写图片描述

search algorithm for single tree

  • enumerate the possible tree structures q(x)
  • Calculate the according structure score for the q(x), using the scoring function:
    Obj=−12∑j=1TG2jHj+λ+γT
  • find the best tree structure,and use the optimal leaf weight
    w∗j=−G2jHj+λ

But… there can be infinite possible tree structures..

so in practice we do not enumerate but greedly grow the tree:

  • start from tree with depth 0
  • For each leaf node of the tree, try to add a split. The change of
    objective after adding the split is:

    Gain=G2LHL+λ+G2RHR+λ−(GL+GR)2HL+HR+λ−γ

    • the score of left/right child : G2LHL+λ & G2RHR+λ
    • the score of if we do not split : (GL+GR)2HL+HR+λ
    • The complexity cost by introducing additional leaf: γ
  • Remaining question: how do we find the best split?

Efficient Finding of the Best Split

first take a look at the Algorithm for Split Finding

Algorithm for Split Finding

  • For each node, enumerate over all features
  • For each feature, sorted the instances by feature value
  • Use a linear scan to decide the best split along that feature
  • Take the best split solution along all the features

Time Complexity growing a tree of depth K is O(ndKlogn) ,or, each level need O(nlogn) time to sort.
There are d features, and we need to do it for K level

  • This can be further optimized (e.g. use approximation or caching the sorted features)
  • Can scale to very large dataset

Let f and g be two functions defined on some subset of the real numbers. One writes

What about Categorical Variables?

  • Some tree learning algorithm handles categorical variable and continuous variable separately.Actually it is not necessary,
  • We can easily use the scoring formula we derived to score split based on categorical variables.We can encode the categorical variables into numerical vector
    using one-hot encoding. Allocate a #categorical length vector
    zj={1,0,if x is in category jothers
  • The vector will be sparse if there are lots of categories, the learning algorithm is preferred to handle sparse data

Pruning and Regularization

  • Pre-stopping

    • Stop split if the best split have negative gain
    • But maybe a split can benefit future splits..
  • Post-Prunning

    • Grow a tree to maximum depth,
    • recursively prune all the leaf splits with negative gain

Recap: Boosted Tree Algorithm

  • Add a new tree in each iteration
  • Beginning of each iteration, calculate gi,hi
  • Use the statistics to greedily grow a tree ft(x)
    Obj=−12∑j=1TG2jHj+λ+γT
  • Add  ft(x) to the model ŷ (t)i=ŷ (t−1)i+ft(xi)
    Usually, instead we do ŷ (t)i=ŷ (t−1)i+ϵft(xi)
    ϵ is called step-size or shrinkage, usually set around 0.1
    This means we do not do full optimization in each step and reserve chance for future rounds, it helps prevent overfitting

Questions 1

How can we build a boosted tree classifier to do weighted regression problem, such that each instance have a importance weight?

  • Define objective, calculate, feed it to the old tree learning algorithm we have for un-weighted version
  • Again think of separation of model and objective, how does the theory can help better organizing the machine learning toolkit

Questions 2

Back to the time series problem, if I want to learn step functions over time. Is there other ways to learn the time splits, other than the top down split approach?

这里写图片描述

  • All that is important is the structure score of the splits
    Obj=−12∑j=1TG2jHj+λ+γT

    • Top-down greedy, same as trees
    • Bottom-up greedy, start from individual points as each group, greedily merge neighbors
    • Dynamic programming, can find optimal solution for this case

Summary

• The separation between model, objective, parameters can be helpful for us to understand and customize learning models
• The bias-variance trade-off applies everywhere, including learning in functional space
• We can be formal about what we learn and how we learn. Clear understanding of theory can be used to guide cleaner implementation.

机器学习---xgboost算法 问题上表现的十分顶尖,本节将较详细的介绍XGBoost的算法原理。成和剪枝分别对应了经验风险最小化和结构风险最小化, XGBoost的决策树生成是结构风险最小。式(1.1)称为经验风险最小化,训练得到的模型复杂度较高。出结果, 是模型的输出结果;等式右边第⼀部分是模型的训练误差,第⼆部分是正则化项,这里。其中,F是假设空间,假设空间是在已知属性和属性可能取值的情况下,对所有可能满足目标的情。最小化,结构风险最小化的模型往往对训练数据以及未知的测试数据都有较好的预测。的正则化项是K棵树的正则化项相加而来的。 阅读详情

相关推荐

陈天奇《Introduction to Boosted Trees》PPT 缩略版笔记

深入研究了一下陈天奇Boosted Tree的PPT,做了点简单的笔记,可以说是PPT的缩略版: 框架有了,截了些重要的图和公式。 虽然简略,但是足以学习大牛思考问题的方式。 Review of key concepts of supervised learning Elements in Supervised Learning Model Parameters Objective func...

山上之城 2623

XGBoost模型详解

1.什么是XGBoost?   GBDT,它是一种基于boosting增强策略的加法模型,训练的时候采用前向分布算法进行贪婪的学习,每次迭代都学习一棵CART树来拟合之前 t−1t-1t−1 棵树的预测结果与训练样本真实值的残差。XGBoost对GBDT进行了一系列优化,比如损失函数进行了二阶泰勒展开、目标函数加入正则项、支持并行和默认缺失值处理等,在可扩展性和训练速度上有了巨大的提升,但其核心思想没有大的变化。 2.XGBoost的核心原理 2.1 如何构造目标函数?   对于一个给定有 nnn 个样本和

weixin_44852067的博客 2万+

深入解析Cuk、Zeta和Sepic拓扑:非隔离型开关电源的设计奥秘

本文深入解析了Cuk、Zeta和Sepic三种非隔离型开关电源拓扑的设计奥秘。它们均能实现升降压转换,但特性各异:Cuk拓扑输出反向电压,输入输出纹波极低;Sepic拓扑输出同极性电压,应用广泛;Zeta拓扑输出纹波小,适合精密供电。文章详细对比了其电路结构、工作原理、核心公式及选型指南,帮助工程师根据输入电压范围、输出极性及纹波要求,灵活选择最合适的拓扑方案。

weixin_28308325的博客 479

XGBoost算法介绍

XGBoost算法介绍一、简介二、基本原理三、目标函数新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入 一、简介   XGBoost(eXtreme Gradient Boosting)又叫极度梯度提升树,是boosting

Silence的博客 5万+

半导体AMHS系统振动控制技术演进:从0.5G到超低振动的工艺革命

在半导体制造进入埃米级时代后,AMHS的振动控制能力将成为区分厂商技术等级的标尺。国内企业通过“弹性机械设计-混合主动控制-智能调度”的三重创新,正逐步突破0.2G阈值,支撑12英寸晶圆厂向3nm/2nm制程升级。未来,振动抑制不再仅是物流系统的性能参数,而是与光刻、刻蚀等核心工艺深度耦合的基础能力,这将重塑半导体设备产业的竞争格局。

m0_60674045的博客 1585

3分钟接入满血版DeepSeek-R1:字节火山引擎手把手教程!免费50万tokens!

3分钟接入满血版DeepSeek-R1:字节火山引擎手把手教程!免费50万tokens!

hunteritself的博客 2万+

【机器学习】XGBoost

XGBoost(eXtreme Gradient Boosting)极度梯度提升树,属于集成学习中的boosting框架算法。对于提升树,简单说就是一个模型表现不好,继续按照原来模型表现不好的那部分训练第二个模型,依次类推。本质思想与GBDT一致,构建多个基学习器使用加法模型,学习前面基学习器的结果与真实值的偏差,通过多个学习器的学习,不断降低模型值和实际值的差。最终模型的预测结果是由所有基学习器预测结果的加和。

Dong_ZH的博客 1万+

Hyper-V集群部署指南

工欲善其事,必先利其器。搭建一个方便管理的服务集群,是分布式学习很重要的环境。 目前流行的虚拟机产品主要为Vmware 和 win10自带的Hyper-V(win10家庭版无此功能),网上关于Vmware的教程更多,显然它更容易上手,但Hyper-V也算是一个很不错的产品,这里记录一下我的学习过程: 目录 Hyper-V的安装 服务集群的搭建 虚拟机的网络通信 NAT网络的搭建 端口映射 Linux的静态IP 虚拟机的自启动问题 Hyper-V的安装 也不能算说是安装,如果你的win1

Swing 6922

【ML paper】Introduction to Boosted Trees

本文是对陈天奇关于Boosted Tree介绍slides的读后梳理。第一次读论文XGBoost: A Scalable Tree Boosting System的时候很懵逼,于是找到了这份slides,这里天奇大佬的介绍很细致,本篇将主要叙述slides中与BT原理直接相关的内容。 0.BT的学习思路 1.我们想要学习什么:模型,目标。 2.如何学习:优化方法。 3.trade-o...

lemonade13的博客 846

论文阅读------Exposure Fusion: A Simple and Practical Alternative to High Dynamic Range Photography

Mertens T, Kautz J, Van Reeth F. Exposure fusion: A simple and practical alternative to high dynamic range photography[C]//Computer graphics forum. Oxford, UK: Blackwell Publishing Ltd, 2009, 28(1): 161-171. 摘要 本文提出了一种将包围曝光的序列融合到高质量图像中的技术,而无需先转换为高动态范围(HD.

qq_25283239的博客 3397

毕业设计:丹麦电力电价预测预测未来24小时的电价pytorch+lstm+历史特征和价格+时间序列 电价预测模型资源 完整代码数据可直接运行

毕业设计:丹麦电力电价预测预测未来24小时的电价pytorch+lstm+历史特征和价格+时间序列 电价预测模型资源 完整代码数据可直接运行

356

[阅读笔记]Introduction to Boosted Trees

概念(要学什么)回归树(CART)回归树emsemble模型$$y_i = \sum_{k=1}^{K}f_k(x_i) , f \in F$ $参数GB(如何学习)additve training(boosting)L(t)=∑i=1nl(yi,ŷ (t−1)i+ft(xi))+Ω(ft)L^{(t)}=\sum_{i=1}^n l(y_i, \hat{y}_{i}^{(t-1)} + f_t(

casmaster的专栏 608

vue3 - 最新详细实现高德地图绘制动态热力图详细教程,在某区域或城市地图上做“热力图层“展示人流量、旅游人口密度、热量图、全国地区地理热力图,利用颜色的深浅表示密度或强度等场景(详细示例代码教程)

vue3,nuxt3,高德地图,热力图,绘制热力图层,人流量,vue3使用高德地图实现某个区域热力图,vue3高德地图api加载热力图及关闭,接收热力图数据并渲染热力图,关掉热力图,Vue使用高德API制作热力图,热力图加载不出来,电子围栏围住热力图,vue3中使用高德地图渲染热力图组件,高德地图使用热力图详细教程,报错,卡顿,出不来怎么办,无法关闭,怎么解决这个问题,出错,城市名称,城市某个街道,城区,省份,市区,县城,乡镇,村,各省份的热力图,交通流量,人口流量,密度,旅游出行,人口数量,颜色介绍,深浅

✅ 精选推荐文章 5207

XGBOOST--Introduction to Boosted Trees

XGBOOST–Introduction to Boosted Trees cite:https://xgboost.readthedocs.io/en/stable/tutorials/model.html Introduction to Boosted Tree XGBoost stands for “Extreme Gradient Boosting”, where the term “Gradient Boosting” originates from the paper Greedy Functi

The_onlyway的博客 224

2026 年第十六届MathorCup数学应用挑战赛题目C题中老年人群高血脂症的风险预警及干预方案优化 2026妈妈杯 详细思路、代码、模型

2026 年第十六届MathorCup数学应用挑战赛题目 C题中老年人群高血脂症的风险预警及干预方案优化 人口老龄化进程的持续加快,使得40岁及以上中老年人群成为 慢性病防控的核心群体,其中高血脂症的发病率呈逐年攀升态势, 已成为诱发冠心病、脑梗死等心脑血管疾病的重要危险因素,严重 威胁中老年群体的心血管健康与生活质量,也加重了基层医疗的慢 病管理负担。从中医体质学视角来看,体质禀赋与偏颇是疾病发生 发展的内在根基,其中痰湿体质为中老年高血脂症的高发体质类型, 该体质人群存在痰湿内蕴、脾胃运化失常、水湿代谢

YOLO 756

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

Introduction to Boosted Trees 学习

今天学习下《Introduction to Boosted Trees》 content Review of key concepts of supervised learning Regression Tree and Ensemble (What are we Learning) Gradient Boosting (How do we Learn) Summary 一、Review...

yuandong_D的博客 294

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

[翻译] 提升树算法的介绍(Introduction to Boosted Trees)

[翻译] 提升树算法的介绍(Introduction to Boosted Trees) 1. 有监督学习的要素 XGBoost 适用于有监督学习问题。在此类问题中,我们使用多特征的训练数据集 \(x_i\) 去预测一个目标变量 \(y_i\) 。在专门学习树模型前,我们先回顾一下有监督学习的基本要素。 Elements of Supervised Learning XGBoost is u...

weixin_30443813的博客 692

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

Boosted Trees简介【翻译+自己的理解】

原文 https://homes.cs.washington.edu/~tqchen/pdf/BoostedTree.pdf 华盛顿大学的 Introduction to Boosted Trees. Tianqi Chen. 本文结合该论文和网上其他资料,在自己理解之后,书写下来~ 文章目录原文监督学习Regression Tree and EnsembleRegression Tree ...

gc.collect() 3224

(XGBoost)提升树入门介绍(Inrtoduction to Boosted Trees)

提升树入门介绍(Inrtoduction to Boosted Trees) Author : Jasper Yang School : Bupt 这是一篇翻译文,翻译的内容是 XGBoost 官网的原理介绍 Introduction to Boosted Trees 这篇文章。如需转载请注明。我自己在做实验中感觉遇到了瓶颈,我认为是我对这个模型的熟悉度太差,因而需要补一补知识,也希望能帮到大家。

Minsta's blog 3370

别人说的Boosted Tree

原文:http://www.52cs.org/?p=429 二次转载参考:http://dataunion.org/15787.html 作者:陈天奇,毕业于上海交通大学ACM班,现就读于华盛顿大学,从事大规模机器学习研究。 注解:truth4sex  编者按:本文是对开源xgboost库理论层面的介绍,在陈天奇原文《梯度提升法和Boosted Tree》的基础上,做了

3317

XGBoost 与 Boosted Tree(GBDT)(转)

转自:XGBoost与Boosted Tree | 我爱计算机 1. 前言   应 @龙星镖局 兄邀请写这篇文章。作为一个非常有效的机器学习方法,Boosted Tree是数据挖掘和机器学习中最常用的算法之一。因为它效果好,对于输入要求不敏感,往往是从统计学家到数据科学家必备的工具之一,它同时也是kaggle比赛冠军选手最常用的工具。最后,因为它的效果好,计算复杂度不高,也在工业界中有大量的应

郝春雨的博客 4065

Boosted Tree

原文:http://www.52cs.org/?p=429 作者:陈天奇,毕业于上海交通大学ACM班,现就读于华盛顿大学,从事大规模机器学习研究。 注解:truth4sex 编者按:本文是对开源xgboost库理论层面的介绍,在陈天奇原文《梯度提升法和Boosted Tree》的基础上,做了如下注解:1)章节划分;2)注解和参考链接(以蓝色和红色字体标注)。备注:图片可点击查看清晰版。 ...

weixin_34029949的博客 84

Boosted Tree:一篇很有见识的文章

Boosted Tree:一篇很有见识的文章 6,125 次阅读 - 文章 作者:陈天奇,毕业于上海交通大学ACM班,现就读于华盛顿大学,从事大规模机器学习研究。 注解:truth4sex  编者按:本文是对开源xgboost库理论层面的介绍,在陈天奇原文《梯度提升法和Boosted Tree》的基础上,做了如下注解:1)章节划分;2)注解和参考链接(以蓝色和红色字体标注)。备注

周红伟讲AI 1万+

机器学习之-BoostedTree

1. 前言 应 @龙星镖局  兄邀请写这篇文章。作为一个非常有效的机器学习方法,Boosted Tree是数据挖掘和机器学习中最常用的算法之一。因为它效果好,对于输入要求不敏感,往往是从统计学家到数据科学家必备的工具之一,它同时也是kaggle比赛冠军选手最常用的工具。最后,因为它的效果好,计算复杂度不高,也在工业界中有大量的应用。 2. Boosted Tree的若干同义词 说到这

Lizo_Is_Me的专栏 4685
上一篇: 随机优化工具 Stochastic Optimization Techniques
chiechie
博客等级 码龄17年 3粉丝 6原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值