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 版)
66
|
第
2
章
这一轮的探索不一定要多么彻底,关键是迈开第一步,快速获得洞见,这将有助于你获
得非常棒的第一个原型。这也是一个不断迭代的过程:一旦你的原型产生并且开始运行,
你可以分析它的输出以获得更多洞见,然后再次回到这个探索步骤。
2.5 机器学习算法的数据准备
现在,终于是时候给你的机器学习算法准备数据了。这里你应该编写函数来执行,而不
是手动操作,原因如下:
•
你可以在任何数据集上轻松重现这些转换(例如,获得更新的数据集之后)。
•
你可以逐渐建立起一个转换函数的函数库,可以在以后的项目中重用。
•
你可以在实时系统中使用这些函数来转换新数据,再输入给算法。
•
你可以轻松尝试多种转换方式,查看哪种转换的组合效果最佳。
但是现在,让我们先回到一个干净的训练集(再次复制 strat_train_set),然后将预
测器和标签分开,因为这里我们不一定对它们使用相同的转换方式(需要注意 drop() 会
创建一个数据副本,但是不影响 strat_train_set):
housing = strat_train_set.drop("median_house_value", axis=1)
housing_labels = strat_train_set["median_house_value"].copy()
2.5.1 数据清理
大部分的机器学习算法无法在缺失的特征上工作,所以我们要创建一些函数来辅助它。
前面我们已经注意到 total_bedrooms 属性有部分值缺失,所以我们要解决它。有以
下三种选择: ...
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