mirror of
https://github.com/ArthurDanjou/handson-ml3.git
synced 2026-01-28 18:50:26 +01:00
Replace handson-ml2 with handson-ml3, and fix figure chapter numbers
This commit is contained in:
@@ -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 6–3\n",
|
||||
"# not in the book – this cell generates and saves Figure 7–3\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 6–5\n",
|
||||
"# not in the book – this cell generates and saves Figure 7–5\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 6–6\n",
|
||||
"# not in the book – this cell generates and saves Figure 7–6\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 6–8\n",
|
||||
"# not in the book – this cell generates and saves Figure 7–8\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 6–9\n",
|
||||
"# not in the book – this cell generates and saves Figure 7–9\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 6–10\n",
|
||||
"# not in the book – this cell generates and saves Figure 7–10\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",
|
||||
|
||||
Reference in New Issue
Block a user