Skip to Content
机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
book

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

by Aurélien Géron
October 2020
Intermediate to advanced
693 pages
16h 26m
Chinese
China Machine Press
Content preview from 机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
134
|
第
4
章
y_val_predict = sgd_reg.predict(X_val_poly_scaled)
val_error = mean_squared_error(y_val, y_val_predict)
if
val_error < minimum_val_error:
minimum_val_error = val_error
best_epoch = epoch
best_model = clone(sgd_reg)
请注意,在使用 warm_start = True 的情况下,当调用 fit() 方法时,它将在停止
的地方继续训练,而不是从头开始。
4.6 逻辑回归
正如第 1 章中提到过的,一些回归算法也可用于分类(反之亦然)。逻辑回归(Logistic
回归,也称为 Logit 回归)被广泛用于估算一个实例属于某个特定类别的概率。(比
如,这封电子邮件属于垃圾邮件的概率是多少?)如果预估概率超过 50%,则模型预测
该实例属于该类别(称为正类,标记为“1”),反之,则预测不是(称为负类,标记为
“0”)。这样它就成了一个二元分类器。
4.6.1 估计概率
所以逻辑回归是怎么工作的呢?与线性回归模型一样,逻辑回归模型也是计算输入特征
的加权和(加上偏置项),但是不同于线性回归模型直接输出结果,它输出的是结果的数
理逻辑值(参见公式 4-13)。
公式 4-13:逻辑回归模型的估计概率(向量化形式)
ph
ˆ
= =
θ
() ( )xx
σ
T
θ
逻辑记为
σ
(·),是一个 sigmoid ...
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

算法技术手册(原书第2 版)

算法技术手册(原书第2 版)

George T.Heineman, Gary Pollice, Stanley Selkow
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey

Publisher Resources

ISBN: 9787111665977