Skip to Content
面向数据科学家的实用统计学
book

面向数据科学家的实用统计学

by Peter Bruce, Andrew Bruce
October 2018
Beginner to intermediate
238 pages
6h 32m
Chinese
Posts & Telecom Press
Content preview from 面向数据科学家的实用统计学
统计机器学习
|
175
基尼系数
不要将基尼不纯度与
基尼系数
混淆。虽然它们表示相似的概念,但是基尼系
数仅限于二分类问题,并与
AUC
度量有关(参见
5.4.5
节 )。
在上一节介绍的递归分区算法中,我们使用了不纯度作为度量。对于该算法给出的每个数
据分区,算法测量由拆分所产生的每个子分区的不纯度,然后计算加权均值,并选择(在
每个阶段中)生成最低加权均值的子分区。
6.2.4
 阻止树模型继续生长
随着树变得越来越大,拆分规则变得越来越详细,树也逐渐从识别确定数据中真实可靠关
系的“大”规则,转变为识别仅反映噪声的“小”规则。一棵完全长成树会生成完全纯粹
的叶子,进而在训练数据上达到
100%
的分类正确率。
当然,这个正确率是不实际的——树过拟合了数据(参见
6.1.5
节中的知识点“偏差与方差
的权衡”)。这表明我们在训练数据中拟合了噪声,而不是我们想要在新数据中识别的信号。
剪枝
一种减小树规模的简单又直观的方法,是对树的末端和较小的分支做
剪枝
,
从而生成较小规模的树。那么我们要对树剪枝到哪一层?一种常用的技术是
剪枝到验证数据集上的误差达到最小。如果组合了来自多个树模型的预测
(参见
6.3
节),就需要一种能阻止树模型生长的方法。在使用交叉验证确定
树在组合方法中的生长程度时,剪枝会发挥作用。
对于某个阶段,我们需要一种方法确定何时停止树模型的生长。该方法也可泛化到新数
据。常用的停止拆分方法有以下两种。
•
如果拆分后的子分区过小,或末端叶子的规模过小,就应避免拆分。在 rpart 软件包中,
这些约束是由参数 minsplit ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

基于Python的智能文本分析

基于Python的智能文本分析

Benjamin Bengfort, Rebecca Bilbro, Tony Ojeda
Python数据处理

Python数据处理

Jacqueline Kazil, Katharine Jarmul
精通機器學習

精通機器學習

Aurélien Géron
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普

Publisher Resources

ISBN: 9787115493668