Skip to Content
TensorFlow构建机器学习项目
book

TensorFlow构建机器学习项目

by Posts & Telecom Press, Rodolfo Bonnin
May 2024
Intermediate to advanced
204 pages
3h 44m
Chinese
Packt Publishing
Content preview from TensorFlow构建机器学习项目

第4章 逻辑回归

在之前的章节中,我们学习了如何线性回归建模。线性回归模型中,通过最小化误差函数,计算出权重和偏差。

但是这种方法的使用范围有很大的限制,只有那些结果是连续变量的问题可以使用线性回归。

但是,如果我们面对的是离散的变量呢?比如,一个特征的是否出现;是否是金色头发;就医者是否得病。

这些问题是本章要解决的问题。

线性回归的目标是基于一个连续方程预测一个值,而本章的目标是预测一个样本属于某个确定类的概率。

本章中,我们将会使用一个泛化的线性模型来解决回归问题。不同于之前的线性回归,我们这次的目标是解决一个分类问题,也就是将观察值贴上某个标签,或者是分入某个预先定义的类。

图4-1给我们展示了回归问题与分类问题的区别。第一幅图中(线性回归),当输入x连续变化的时候,y也是连续变化的。

但是,在第二幅图中就不一样了。不管输入x怎么变化,y只有两种可能性。左边部分数据趋向于0,右边部分数据趋向于1。

逻辑回归(logistic regression)的这个术语容易让人产生疑惑,明明要处理的是分类问题,为什么叫作回归?回归应该寻找一个连续值,而分类寻找的是离散值。

理解的关键就是,我们不仅仅是寻找一个表示类的离散值,我们还寻找表示属于该类可能性的连续值。

图4-1 回归与分类的区别

在我们开始学习Logistic函数之前,我们先复习一个它的逆函数Logit函数,Logit函数和Logistic函数息息相关,它们好多的性质是关联在一起的。 ...

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

人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
深度学习实战手册(R语言版)

深度学习实战手册(R语言版)

Posts & Telecom Press, PKS Prakash, Achyutuni Sri Krishna Rao
Lua游戏AI开发指南

Lua游戏AI开发指南

Posts & Telecom Press, David Young
TensorFlow深度学习项目实战

TensorFlow深度学习项目实战

Posts & Telecom Press, Luca Massaron, Alberto Boschetti, Alexey Grigorev, Abhishek Thakur

Publisher Resources

ISBN: 9781836203797