Replace handson-ml2 with handson-ml3, and fix figure chapter numbers

This commit is contained in:
Aurélien Geron
2021-11-23 15:42:16 +13:00
parent e38983d595
commit 5bb0366125
23 changed files with 137 additions and 137 deletions

View File

@@ -4,14 +4,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Chapter 6 Ensemble Learning and Random Forests**"
"**Chapter 7 Ensemble Learning and Random Forests**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"_This notebook contains all the sample code and solutions to the exercises in chapter 6._"
"_This notebook contains all the sample code and solutions to the exercises in chapter 7._"
]
},
{
@@ -20,10 +20,10 @@
"source": [
"<table align=\"left\">\n",
" <td>\n",
" <a href=\"https://colab.research.google.com/github/ageron/handson-ml2/blob/master/07_ensemble_learning_and_random_forests.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
" <a href=\"https://colab.research.google.com/github/ageron/handson-ml3/blob/main/07_ensemble_learning_and_random_forests.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
" </td>\n",
" <td>\n",
" <a target=\"_blank\" href=\"https://kaggle.com/kernels/welcome?src=https://github.com/ageron/handson-ml2/blob/master/07_ensemble_learning_and_random_forests.ipynb\"><img src=\"https://kaggle.com/static/images/open-in-kaggle.svg\" /></a>\n",
" <a target=\"_blank\" href=\"https://kaggle.com/kernels/welcome?src=https://github.com/ageron/handson-ml3/blob/main/07_ensemble_learning_and_random_forests.ipynb\"><img src=\"https://kaggle.com/static/images/open-in-kaggle.svg\" /></a>\n",
" </td>\n",
"</table>"
]
@@ -131,7 +131,7 @@
"metadata": {},
"outputs": [],
"source": [
"# not in the book this cell generates and saves Figure 63\n",
"# not in the book this cell generates and saves Figure 73\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
@@ -271,7 +271,7 @@
"metadata": {},
"outputs": [],
"source": [
"# not in the book this cell generates and saves Figure 65\n",
"# not in the book this cell generates and saves Figure 75\n",
"\n",
"def plot_decision_boundary(clf, X, y, alpha=1.0):\n",
" axes=[-1.5, 2.4, -1, 1.5]\n",
@@ -445,7 +445,7 @@
"metadata": {},
"outputs": [],
"source": [
"# not in the book this cell generates and saves Figure 66\n",
"# not in the book this cell generates and saves Figure 76\n",
"\n",
"from sklearn.datasets import fetch_openml\n",
"\n",
@@ -478,7 +478,7 @@
"metadata": {},
"outputs": [],
"source": [
"# not in the book this cell generates and saves Figure 68\n",
"# not in the book this cell generates and saves Figure 78\n",
"\n",
"m = len(X_train)\n",
"\n",
@@ -613,7 +613,7 @@
"metadata": {},
"outputs": [],
"source": [
"# not in the book this cell generates and saves Figure 69\n",
"# not in the book this cell generates and saves Figure 79\n",
"\n",
"def plot_predictions(regressors, X, y, axes, style,\n",
" label=None, data_style=\"b.\", data_label=None):\n",
@@ -713,7 +713,7 @@
"metadata": {},
"outputs": [],
"source": [
"# not in the book this cell generates and saves Figure 610\n",
"# not in the book this cell generates and saves Figure 710\n",
"\n",
"fix, axes = plt.subplots(ncols=2, figsize=(10,4), sharey=True)\n",
"\n",
@@ -753,7 +753,7 @@
" housing_path = Path() / \"datasets\" / \"housing\"\n",
" if not (housing_path / \"housing.csv\").is_file():\n",
" housing_path.mkdir(parents=True, exist_ok=True)\n",
" root = \"https://raw.githubusercontent.com/ageron/handson-ml2/master/\"\n",
" root = \"https://raw.githubusercontent.com/ageron/handson-ml3/main/\"\n",
" url = root + \"datasets/housing/housing.tgz\"\n",
" tgz_path = housing_path / \"housing.tgz\"\n",
" urllib.request.urlretrieve(url, tgz_path)\n",