mirror of
https://github.com/ArthurDanjou/handson-ml3.git
synced 2026-01-14 12:14:36 +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 7 – Dimensionality Reduction**"
|
||||
"**Chapter 8 – Dimensionality Reduction**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"_This notebook contains all the sample code and solutions to the exercises in chapter 7._"
|
||||
"_This notebook contains all the sample code and solutions to the exercises in chapter 8._"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -20,10 +20,10 @@
|
||||
"source": [
|
||||
"<table align=\"left\">\n",
|
||||
" <td>\n",
|
||||
" <a href=\"https://colab.research.google.com/github/ageron/handson-ml2/blob/master/08_dimensionality_reduction.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/08_dimensionality_reduction.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/08_dimensionality_reduction.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/08_dimensionality_reduction.ipynb\"><img src=\"https://kaggle.com/static/images/open-in-kaggle.svg\" /></a>\n",
|
||||
" </td>\n",
|
||||
"</table>"
|
||||
]
|
||||
@@ -175,7 +175,7 @@
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# not in the book – this code generates and saves Figure 7–2\n",
|
||||
"# not in the book – this code generates and saves Figure 8–2\n",
|
||||
"\n",
|
||||
"import matplotlib.pyplot as plt\n",
|
||||
"from mpl_toolkits.mplot3d import Axes3D\n",
|
||||
@@ -243,7 +243,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# not in the book – this code generates and saves Figure 7–3\n",
|
||||
"# not in the book – this code generates and saves Figure 8–3\n",
|
||||
"\n",
|
||||
"fig = plt.figure()\n",
|
||||
"ax = fig.add_subplot(1, 1, 1, aspect='equal')\n",
|
||||
@@ -279,7 +279,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# not in the book – this code generates and saves Figure 7–4\n",
|
||||
"# not in the book – this code generates and saves Figure 8–4\n",
|
||||
"\n",
|
||||
"from matplotlib.colors import ListedColormap\n",
|
||||
"\n",
|
||||
@@ -303,7 +303,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# not in the book – this code generates and saves plots for Figure 7–5\n",
|
||||
"# not in the book – this code generates and saves plots for Figure 8–5\n",
|
||||
"\n",
|
||||
"plt.figure(figsize=(10, 4))\n",
|
||||
"\n",
|
||||
@@ -330,7 +330,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# not in the book – this code generates and saves plots for Figure 7–6\n",
|
||||
"# not in the book – this code generates and saves plots for Figure 8–6\n",
|
||||
" \n",
|
||||
"axes = [-11.5, 14, -2, 23, -12, 15]\n",
|
||||
"x2s = np.linspace(axes[2], axes[3], 10)\n",
|
||||
@@ -402,7 +402,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# not in the book – this code generates and saves Figure 7–7\n",
|
||||
"# not in the book – this code generates and saves Figure 8–7\n",
|
||||
"\n",
|
||||
"angle = np.pi / 5\n",
|
||||
"stretch = 5\n",
|
||||
@@ -795,7 +795,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# not in the book – this cell generates and saves Figure 7–9\n",
|
||||
"# not in the book – this cell generates and saves Figure 8–9\n",
|
||||
"\n",
|
||||
"plt.figure(figsize=(7, 4))\n",
|
||||
"for idx, X in enumerate((X_train[::2100], X_recovered[::2100])):\n",
|
||||
@@ -1027,7 +1027,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# not in the book – this cell generates and saves Figure 7–10\n",
|
||||
"# not in the book – this cell generates and saves Figure 8–10\n",
|
||||
"\n",
|
||||
"plt.title(\"Unrolled swiss roll using LLE\")\n",
|
||||
"plt.scatter(X_unrolled[:, 0], X_unrolled[:, 1],\n",
|
||||
@@ -1099,7 +1099,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# not in the book – this cell generates and saves Figure 7–11\n",
|
||||
"# not in the book – this cell generates and saves Figure 8–11\n",
|
||||
"\n",
|
||||
"titles = [\"MDS\", \"Isomap\", \"t-SNE\"]\n",
|
||||
"\n",
|
||||
|
||||
Reference in New Issue
Block a user