Skip to Content
Spark快速大数据分析(第2版)
book

Spark快速大数据分析(第2版)

by Jules S. Damji, Brooke Wenig, Tathagata Das, Denny Lee
November 2021
Intermediate to advanced
340 pages
10h 46m
Chinese
Posts & Telecom Press
Content preview from Spark快速大数据分析(第2版)
MLlib
实现机器学习
255
| 1.0| [1.0]|115.0|
| 1.0| [1.0]|105.0|
| 1.0| [1.0]| 86.0|
| 1.0| [1.0]|100.0|
| 2.0| [2.0]|220.0|
+--------+--------+-----+
想必你已经注意到了,在
Scala
代码中实例化新的
VectorAssembler
对象时,需要使用设置
方法修改输入列和输出列。在
Python
,既可以直接向
VectorAssembler
的构造函数传入
参数,也可以使用设置方法,但在
Scala
中只能使用设置方法。
接下来我们将学习线性回归的基本原理,如果已经有所了解,你可以直接阅读
10.2.5
节。
10.2.4
 理解线性回归
线性回归为因变量(标签)和至少一个自变量(特征)之间建立线性关系模型。我们的场
景是根据给定的卧室数量来预测
Airbnb
房租价格,从而拟合一个线性回归模型。
在图
10-6
中有一个特征
x
和一个输出
y
(因变量)。线性回归尝试用一条直线拟合
x
y
关系,并用等式表示这条直线。对于标量值,可以表示为
y
=
mx
+
b
,其中
m
是斜率,
b
是偏移量或截距。
图中的圆点表示数据集中真实的
(
x
,
y
)
数据对
,那条实线表示这个数据集的最佳拟合直线。
数据点并没有完美地排成一条直线,因此一般将线性回归看作拟合
y
mx
+
b
+
ε
的模型,
其中
ε
epsilon
)表示每条
记录
x
服从某种分布独立产生的误差。这就是模型预测值与真
实值之间的误差。我们通常认为
ε
服从高斯分布,也称作正态分布 ...
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

数据驱动力:企业数据分析实战

数据驱动力:企业数据分析实战

Carl Anderson
数据压缩入门

数据压缩入门

Colt McAnlis, Aleks Haecky
解密金融数据

解密金融数据

Justin Pauley

Publisher Resources

ISBN: 9787115576019