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版)
回归与预测
|
155
4.7.2
 样条回归
多项式回归只能捕获非线性关系中一定数量的曲线性质。如果添加更高阶的项,比如三次
多项式,会在回归方程中带来我们不想要的“波动性”。另一种(通常也是更好的)对非
线性关系建模的方法是
样条回归
,它提供了一种在固定点之间平滑地插值的方法。样条最
初是制图员用来绘制平滑曲线的工具,在船舶和飞行器制造中使用得尤其普遍。
样条是通过压铁(俗称“鸭子”)将一支细长的木条弯成曲线形状而制成的(见图
4-1
1
)。
图 4-11:样条最初是使用可弯曲的木条和俗称“鸭子”的压铁而制成的,它是制图员用来拟合曲线
的工具(照片经 Bob Perry 允许,免费使用)
样条的技术定义是一系列连续的分段多项式,它是在第二次世界大战期间由美国阿伯丁武
器试验场的罗马尼亚数学家
I.
J. Schoenberg
首次提出的。分段多项式通过预测变量中的一
系列固定点(称为
节点
)平滑地连接起来。样条回归要比多项式回归复杂得多,通常需要
统计软件来处理样条回归拟合时的细节。
R
包
splines
中有一个
bs
函数,可以在回归模型
中创建一个
b-spline
(基本样条)项
。例如,下面的代码可以向房屋回归模型中添加一个
b-spline
项:
library(splines)
knots <- quantile(house_98105$SqFtTotLiving, p=c(.25, .5, .75))
lm_spline <- lm(AdjSalePrice ~ bs(SqFtTotLiving, knots=knots, ...
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