Notebooks zum Lektüre
 
Go to file
Aurélien Geron d2b4c73e97 Update code to latest version of Pandas, fixes #633 2024-06-05 11:12:39 +12:00
.github/ISSUE_TEMPLATE Replace handson-ml2 with handson-ml3, and fix figure chapter numbers 2021-11-23 15:42:16 +13:00
docker Fix typo in docker/README.md 2024-03-20 11:18:00 +09:00
images Add notebook extra_ann_architectures.ipynb 2024-06-03 23:39:00 +12:00
.gitignore Move datasets to project ageron/data to shrink this repo 2022-02-19 21:36:43 +13:00
01_the_machine_learning_landscape.ipynb Update lib versions and add pydot, fixes #29 2022-09-22 19:14:01 +12:00
02_end_to_end_machine_learning_project.ipynb Add a note about the fact that KMeans init changed in Scikit-Learn 1.3 so results will differ 2023-11-14 16:34:39 +13:00
03_classification.ipynb Rename sparse to sparse_output in OneHotEncoder 2023-11-14 13:55:13 +13:00
04_training_linear_models.ipynb Update lib versions and add pydot, fixes #29 2022-09-22 19:14:01 +12:00
05_support_vector_machines.ipynb Rename svm_clf to svm_reg in chapter 5 exercise, fixes #120 2024-02-01 09:17:56 +13:00
06_decision_trees.ipynb Update lib versions and add pydot, fixes #29 2022-09-22 19:14:01 +12:00
07_ensemble_learning_and_random_forests.ipynb Reverse increasing/decreasing learning rate in solution to exercises 6 and 7, fixes #117 2024-02-01 11:51:55 +13:00
08_dimensionality_reduction.ipynb Fix typo 2023-11-14 15:28:44 +13:00
09_unsupervised_learning.ipynb Set n_init explicitly when creating KMeans or MiniBatchKMeans, to avoid warning 2023-11-14 15:09:10 +13:00
10_neural_nets_with_keras.ipynb Remove tensorboard.dev code examples since the service will shut down in December 2023 2023-11-17 10:30:44 +13:00
11_training_deep_neural_networks.ipynb Add missing math import and n_epochs = 20 2023-11-15 21:23:37 +13:00
12_custom_models_and_training_with_tensorflow.ipynb No longer need super.build() or self.built = True in build() method; also update custom optimizer section and use tf.keras.utils.set_random_seed() instead of tf.random.set_seed() 2023-09-05 11:38:15 +12:00
13_loading_and_preprocessing_data.ipynb Fix cropped images display since they are floats since TF 2.8 2022-09-23 12:05:53 +12:00
14_deep_computer_vision_with_cnns.ipynb Do not reuse optimizer from previous model 2024-01-10 19:15:03 +13:00
15_processing_sequences_using_rnns_and_cnns.ipynb Use verbose=0 when using model.predict() many times 2022-09-23 21:54:25 +12:00
16_nlp_with_rnns_and_attention.ipynb Add comment on biased models 2022-09-25 17:31:58 +13:00
17_autoencoders_gans_and_diffusion_models.ipynb Fix links to Kaggle and Deepnote, and update chapter 17's title 2022-09-23 12:36:09 +12:00
18_reinforcement_learning.ipynb Remove a warning when computing left_proba 2024-01-19 19:01:59 +13:00
19_training_and_deploying_at_scale.ipynb Update lib versions and add pydot, fixes #29 2022-09-22 19:14:01 +12:00
CHANGES.md Clarify which sections are now online 2022-10-20 18:58:10 +13:00
INSTALL.md Change environment name from tf2 to homl3 2021-12-21 11:35:26 +13:00
LICENSE First notebook added: matplotlib 2016-02-16 21:40:20 +01:00
README.md Thanks to Google for the GCP credits 2023-01-06 13:42:24 +13:00
apt.txt Update gym library, and remove unneeded libraries for headless servers 2022-09-24 12:23:42 +12:00
book_equations.pdf Divide MSE_node by m_node in equation 6-4 2021-03-10 18:45:05 +13:00
environment.yml Remove a warning when computing left_proba 2024-01-19 19:01:59 +13:00
extra_ann_architectures.ipynb Add notebook extra_ann_architectures.ipynb 2024-06-03 23:39:00 +12:00
extra_autodiff.ipynb Add notebook outputs 2022-02-19 22:24:54 +13:00
extra_gradient_descent_comparison.ipynb Add notebook outputs 2022-02-19 22:24:54 +13:00
index.ipynb Fix links to Kaggle and Deepnote, and update chapter 17's title 2022-09-23 12:36:09 +12:00
math_differential_calculus.ipynb Fix sin function 2022-05-21 13:21:58 +09:00
math_linear_algebra.ipynb Fix determinant description to match the example 2023-02-04 18:32:14 +13:00
ml-project-checklist.md Fix typos in ML project checklist and requirements 2022-05-12 15:39:15 +09:00
requirements.txt Replace gym with gymnasium 2024-01-30 18:06:36 +13:00
tools_matplotlib.ipynb Update pandas tutorial 2022-05-17 16:31:23 +09:00
tools_numpy.ipynb Remove redundant parentheses 2022-05-13 19:05:00 +09:00
tools_pandas.ipynb Update code to latest version of Pandas, fixes #633 2024-06-05 11:12:39 +12:00

README.md

Machine Learning Notebooks, 3rd edition

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

Note: If you are looking for the second edition notebooks, check out ageron/handson-ml2. For the first edition, see ageron/handson-ml.

Quick Start

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

  • Open In Colab (recommended)

Colab provides a temporary environment: anything you do will be deleted after a while, so make sure you download any data you care about.

Other services may work as well, but I have not fully tested them:

  • Open in Kaggle

  • Launch binder

  • Launch in Deepnote

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

  • Render nbviewer

  • github.com's notebook viewer also works but it's not ideal: it's slower, the math equations are not always displayed correctly, and large notebooks often fail to open.

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-ml3.git
$ cd handson-ml3

Next, run the following commands:

$ conda env create -f environment.yml
$ conda activate homl3
$ 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.10. If you follow the installation instructions above, that's the version you will get. Any version ≥3.7 should work as well.

I'm getting an error when I 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. If it's an SSL error, see the next question.

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.10/Install\ Certificates.command in a terminal (change 3.10 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. Thanks a lot to Victor Khaustov who submitted plenty of excellent PRs, fixing many errors. And lastly, thanks to Google ML Developer Programs team who supported this work by providing Google Cloud Credit.