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 面向数据科学家的实用统计学
统计机器学习
|
183
图
6-8
的上图和下图分别显示了根据正确率的降低和基尼不纯度的降低这两种方法测得的
变量重要性。两个图中的变量都是按正确率从高到低的顺序排列的。这两种测量方式得到
的变量重要性分值完全不同。
既然正确率的降低是更可靠的度量,我们为什么还要使用基尼不纯度的降低这种测量呢?
默认情况下,randomForest 函数只计算基尼不纯度。该算法一定会给出基尼不纯度,但是
计算变量的模型正确率则需要额外进行一些计算,包括随机置换并预测数据。在计算的复
杂度很重要的情况下,例如在需要拟合数千个模型的生产环境中,我们不应额外增加计
算量。此外,基尼不纯度降低揭示了随机森林在生成拆分规则中使用了哪些变量(回想一
下,该信息很容易在单个简单树模型中看到,但是在随机森林中就会丢失)。通过查看基
尼不纯度降低与模型正确率这两种测定变量重要性方法之间的差异,有可能会找出一些改
进模型的方法。
6.3.4
 超参数
和许多统计机器学习算法一样,随机森林也可以看成一种“黑箱”算法,但是在箱子上会
提供一些调节算法工作方式的旋钮。我们称这些旋钮为
超参数
。超参数是一些需要在拟合
模型前设置的参数,它们并不会在算法训练过程中得到优化。虽然在传统的统计模型中,
我们需要做出一些选择(例如在回归模型中需要选定预测变量),但是随机森林的超参数
更为关键,尤其对于避免产生过拟合的问题。对于随机森林,我们需要介绍两个重要的超
参数。
nodesize
末端节点(即树的叶子)的最小规模。对于分类,默认值为
1
;对于回归,默认值为
5
。
maxnodes ...
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