handson-ml README

The project's README from github.com/ageron/handson-ml. As one markdown file: README.md.

Machine Learning Notebooks

⚠ THE THIRD EDITION OF MY BOOK IS NOW AVAILABLE, AS WELL A PYTORCH VERSION AND MANY TRANSLATIONS.

This project is for the first edition, which is now outdated (it came out in 2017).

This project aims at teaching you the fundamentals of Machine Learning in python. It contains the example code and solutions to the exercises in my O'Reilly book Hands-on Machine Learning with Scikit-Learn and TensorFlow:

book

Quick Start

Want to play with these notebooks online without having to install anything?

Use any of the following services.

WARNING: Please be aware that these services provide temporary environments: anything you do will be deleted after a while, so make sure you download any data you care about.

  • Note: Most of the time, Binder starts up quickly and works great, but when handson-ml is updated, Binder creates a new environment from scratch, and this can take quite some time.

  • Or open it in Deepnote:

Just want to quickly look at some notebooks, without executing any code?

Browse this repository using jupyter.org's notebook viewer:

Note: github.com's notebook viewer also works but it is slower and the math equations are not always displayed correctly.

Want to run this project using a Docker image?

Read the Docker instructions.

Want to install this project on your own machine?

Start by installing Anaconda (or Miniconda), git, and if you have a TensorFlow-compatible GPU, install the GPU driver, as well as the appropriate version of CUDA and cuDNN (see TensorFlow's documentation for more details).

Next, clone this project by opening a terminal and typing the following commands (do not type the first $ signs on each line, they just indicate that these are terminal commands):

$ git clone https://github.com/ageron/handson-ml.git
$ cd handson-ml

Next, run the following commands:

$ conda env create -f environment.yml
$ conda activate tf1
$ python -m ipykernel install --user --name=python3

Finally, start Jupyter:

$ jupyter notebook

If you need further instructions, read the detailed installation instructions.

FAQ

Which Python version should I use?

I recommend Python 3.7. If you follow the installation instructions above, that's the version you will get. Most code will work with other versions of Python 3, but some libraries do not support Python 3.8 or 3.9 yet, which is why I recommend Python 3.7.

I'm getting an error when I call load_housing_data()

Make sure you call fetch_housing_data() before you call load_housing_data(). If you're getting an HTTP error, make sure you're running the exact same code as in the notebook (copy/paste it if needed). If the problem persists, please check your network configuration.

I'm getting an SSL error on MacOSX

You probably need to install the SSL certificates (see this StackOverflow question). If you downloaded Python from the official website, then run /Applications/Python\ 3.7/Install\ Certificates.command in a terminal (change 3.7 to whatever version you installed). If you installed Python using MacPorts, run sudo port install curl-ca-bundle in a terminal.

I've installed this project locally. How do I update it to the latest version?

See INSTALL.md

How do I update my Python libraries to the latest versions, when using Anaconda?

See INSTALL.md

Contributors

I would like to thank everyone who contributed to this project, either by providing useful feedback, filing issues or submitting Pull Requests. Special thanks go to Haesun Park and Ian Beauregard who reviewed every notebook and submitted many PRs, including help on some of the exercise solutions. Thanks as well to Steven Bunkley and Ziembla who created the docker directory, and to github user SuperYorio who helped on some exercise solutions.

handson-ml (ageron/handson-ml)

Searching Database…

这是什么东西?一套用 Python 讲解机器学习基础的 Jupyter 笔记本:这是 O'Reilly 出版的《Hands-on Machine Learning with Scikit-Learn and TensorFlow》第一版书中的示例代码和练习答案。
这是书本身,还是配套的东西?这是配套代码,不是书——由 Aurélien Géron 编写的可运行笔记本,配合这本书使用(出版于 2017 年),书需要另外阅读。
不安装任何东西,我能不能直接玩这些笔记本?可以——把仓库在 Colaboratory(推荐方式)、Binder 或 Deepnote 中打开,全部在浏览器里运行;只是想读一读的话,用 jupyter.org 的笔记本查看器也行。这些服务都是临时环境,想保留的内容记得下载下来。
在我自己电脑上运行需要准备什么?需要 Anaconda 或 Miniconda,再加上 git。克隆仓库,运行 'conda env create -f environment.yml',激活 'tf1' 环境,然后启动 Jupyter。推荐使用 Python 3.7;支持 TensorFlow 的 GPU(带 CUDA 和 cuDNN)是可选的。
这个仓库已标记为废弃,还值得用吗?不适合用来从头学习:这个仓库对应书的第一版,2017 年出版,内容已经过时了。想看最新的内容,作者推荐改看他另外两个仓库 handson-ml3 和 handson-mlp。
这些笔记本到底讲了些什么?先用 scikit-learn 讲机器学习基础,再用 TensorFlow 讲神经网络——也就是书名里那两个库——其中还包括一个房价预测项目。
我调用 load_housing_data() 时报错了,是怎么回事?要先调用 fetch_housing_data()——它负责下载数据,之后 load_housing_data() 才能读取。如果遇到 HTTP 错误,请原封不动地运行笔记本里的代码,并检查你的网络配置。
有没有现成环境的 Docker 镜像?有——仓库里附带了 Docker 使用说明和一个 docker 目录,你可以直接在容器里运行所有内容,不用自己配置 Anaconda。
Creator
ageron
Size
84.9 MB
Stars
25.6K
Updated
CommitMay 19
Age
10y
Commits · 90 Days