Skip to content

Commit 6ec86e2

Browse files
committed
Pushing the docs to dev/ for branch: main, commit 48a3c0b143e3d62050a582eff2c106e17e9dea77
1 parent a7b6c0a commit 6ec86e2

File tree

1,233 files changed

+4494
-4499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,233 files changed

+4494
-4499
lines changed
Binary file not shown.

dev/_downloads/21b82d82985712b5de6347f382c77c86/plot_partial_dependence.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
},
149149
"outputs": [],
150150
"source": [
151-
"import numpy as np\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom sklearn.inspection import partial_dependence\n\nfig = plt.figure()\n\nfeatures = (\"AveOccup\", \"HouseAge\")\npdp = partial_dependence(\n est, X_train, features=features, kind=\"average\", grid_resolution=10\n)\nXX, YY = np.meshgrid(pdp[\"values\"][0], pdp[\"values\"][1])\nZ = pdp.average[0].T\nax = Axes3D(fig)\nfig.add_axes(ax)\n\nsurf = ax.plot_surface(XX, YY, Z, rstride=1, cstride=1, cmap=plt.cm.BuPu, edgecolor=\"k\")\nax.set_xlabel(features[0])\nax.set_ylabel(features[1])\nax.set_zlabel(\"Partial dependence\")\n# pretty init view\nax.view_init(elev=22, azim=122)\nplt.colorbar(surf)\nplt.suptitle(\n \"Partial dependence of house value on median\\n\"\n \"age and average occupancy, with Gradient Boosting\"\n)\nplt.subplots_adjust(top=0.9)\nplt.show()"
151+
"import numpy as np\n\n# unused but required import for doing 3d projections with matplotlib < 3.2\nimport mpl_toolkits.mplot3d # noqa: F401\n\nfrom sklearn.inspection import partial_dependence\n\nfig = plt.figure()\n\nfeatures = (\"AveOccup\", \"HouseAge\")\npdp = partial_dependence(\n est, X_train, features=features, kind=\"average\", grid_resolution=10\n)\nXX, YY = np.meshgrid(pdp[\"values\"][0], pdp[\"values\"][1])\nZ = pdp.average[0].T\nax = fig.add_subplot(projection=\"3d\")\nfig.add_axes(ax)\n\nsurf = ax.plot_surface(XX, YY, Z, rstride=1, cstride=1, cmap=plt.cm.BuPu, edgecolor=\"k\")\nax.set_xlabel(features[0])\nax.set_ylabel(features[1])\nax.set_zlabel(\"Partial dependence\")\n# pretty init view\nax.view_init(elev=22, azim=122)\nplt.colorbar(surf)\nplt.suptitle(\n \"Partial dependence of house value on median\\n\"\n \"age and average occupancy, with Gradient Boosting\"\n)\nplt.subplots_adjust(top=0.9)\nplt.show()"
152152
]
153153
}
154154
],
Binary file not shown.

dev/_downloads/bcd609cfe29c9da1f51c848e18b89c76/plot_partial_dependence.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,10 @@
261261
# Let's make the same partial dependence plot for the 2 features interaction,
262262
# this time in 3 dimensions.
263263
import numpy as np
264-
from mpl_toolkits.mplot3d import Axes3D
264+
265+
# unused but required import for doing 3d projections with matplotlib < 3.2
266+
import mpl_toolkits.mplot3d # noqa: F401
267+
265268
from sklearn.inspection import partial_dependence
266269

267270
fig = plt.figure()
@@ -272,7 +275,7 @@
272275
)
273276
XX, YY = np.meshgrid(pdp["values"][0], pdp["values"][1])
274277
Z = pdp.average[0].T
275-
ax = Axes3D(fig)
278+
ax = fig.add_subplot(projection="3d")
276279
fig.add_axes(ax)
277280

278281
surf = ax.plot_surface(XX, YY, Z, rstride=1, cstride=1, cmap=plt.cm.BuPu, edgecolor="k")

dev/_downloads/scikit-learn-docs.zip

-22.6 KB
Binary file not shown.
-185 Bytes
178 Bytes
121 Bytes
77 Bytes
-76 Bytes

0 commit comments

Comments
 (0)