Skip to Content
数据科学中的实用统计学(第2版)
book

数据科学中的实用统计学(第2版)

by Peter Bruce, Andrew Bruce, Peter Gedeck
October 2021
Intermediate to advanced
289 pages
8h 31m
Chinese
Posts & Telecom Press
Content preview from 数据科学中的实用统计学(第2版)
220
6
6-8
中的上图和下图分别给出了按照准确度下降和按照
Gini
不纯度下降的变量重要
性,其中变量都是按照准确度下降来排序的,这两种测量方式得到的变量重要性分数相
差非常大。
既然准确度下降是一种更加可靠的测量方式,为什么还要使用
Gini
不纯度下降这种方法
呢?默认情况下,
randomForest
只计算
Gini
不纯度:
Gini
不纯度是算法附带的一种结果,
而各个变量的模型准确度需要额外的计算(需要对数据进行随机重排并预测这种数据)。
在计算复杂性比较重要的情况下,比如需要拟合几千个模型的生产情况,可能不值得进行
额外的计算工作。此外,
Gini
不纯度下降方法还可以说明随机森林使用了哪个变量来组成
它的分割规则(回忆一下,这种在简单树中显而易见的规则在随机森林中实际上丢失了)。
6.3.4
 超参数
与很多统计机器学习算法一样,随机森林也被认为是一种“黑箱”算法。有一些参数可以
用来调整该算法的工作方式,这些参数称为
超参数
hyperparameter
,就是需要在拟合模
型之前设定的参数,它们不是在训练过程中进行优化的。在传递的统计模型中,需要做一
些选择(比如选择在回归模型中使用的预测变量),但随机森林超参数的作用更加重要,
特别是为了避免过拟合。特别需要提及的是,随机森林中有两个最为重要的超参数。
nodesize/min_samples_leaf
终端节点(树的叶子节点)的最小体积。在
R
中,对于分类问题,它的默认值是
1
;对
于回归问题,它的默认值是
5
。在
Python
scikit-learn
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机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu

Publisher Resources

ISBN: 9787115569028