Skip to content

Commit 370acf8

Browse files
committed
Pushing the docs to dev/ for branch: main, commit 13d56e9c90e74efbcfc7a3281a74f734fb3d2272
1 parent ea03eac commit 370acf8

File tree

1,308 files changed

+5059
-5798
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,308 files changed

+5059
-5798
lines changed

dev/.buildinfo

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 8a3c7950512bce9aaa2a3a53e2716be7
3+
config: 33c62d0b3c65f9c70b9234643a63348f
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file not shown.

dev/_downloads/21b82d82985712b5de6347f382c77c86/plot_partial_dependence.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@
386386
},
387387
"outputs": [],
388388
"source": [
389-
"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(figsize=(5.5, 5))\n\nfeatures = (\"temp\", \"humidity\")\npdp = partial_dependence(\n hgbdt_model, 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])\nfig.suptitle(\n \"PD of number of bike rentals on\\nthe temperature and humidity GBDT model\",\n fontsize=16,\n)\n# pretty init view\nax.view_init(elev=22, azim=122)\nclb = plt.colorbar(surf, pad=0.08, shrink=0.6, aspect=10)\nclb.ax.set_title(\"Partial\\ndependence\")\nplt.show()"
389+
"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(figsize=(5.5, 5))\n\nfeatures = (\"temp\", \"humidity\")\npdp = partial_dependence(\n hgbdt_model, X_train, features=features, kind=\"average\", grid_resolution=10\n)\nXX, YY = np.meshgrid(pdp[\"grid_values\"][0], pdp[\"grid_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])\nfig.suptitle(\n \"PD of number of bike rentals on\\nthe temperature and humidity GBDT model\",\n fontsize=16,\n)\n# pretty init view\nax.view_init(elev=22, azim=122)\nclb = plt.colorbar(surf, pad=0.08, shrink=0.6, aspect=10)\nclb.ax.set_title(\"Partial\\ndependence\")\nplt.show()"
390390
]
391391
}
392392
],

dev/_downloads/21fba8cadc21699d2b4699b4ccdad10f/plot_beta_divergence.ipynb

-54
This file was deleted.

dev/_downloads/6d09465eed1ee4ede505244049097627/plot_beta_divergence.py

-29
This file was deleted.
Binary file not shown.

dev/_downloads/7012baed63b9a27f121bae611b8285c2/plot_cyclical_feature_engineering.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@
704704
},
705705
"outputs": [],
706706
"source": [
707-
"fig, axes = plt.subplots(ncols=3, figsize=(12, 4), sharey=True)\nfig.suptitle(\"Non-linear regression models\")\npredictions = [\n one_hot_poly_predictions,\n cyclic_spline_poly_predictions,\n gbrt_predictions,\n]\nlabels = [\n \"One hot + polynomial kernel\",\n \"Splines + polynomial kernel\",\n \"Gradient Boosted Trees\",\n]\nfor ax, pred, label in zip(axes, predictions, labels):\n ax.scatter(y.iloc[test_0].values, pred, alpha=0.3, label=label)\n ax.plot([0, 1], [0, 1], \"--\", label=\"Perfect model\")\n ax.set(\n xlim=(0, 1),\n ylim=(0, 1),\n xlabel=\"True demand\",\n ylabel=\"Predicted demand\",\n )\n ax.legend()\n\nplt.show()"
707+
"from sklearn.metrics import PredictionErrorDisplay\n\nfig, axes = plt.subplots(nrows=2, ncols=3, figsize=(13, 7), sharex=True, sharey=\"row\")\nfig.suptitle(\"Non-linear regression models\", y=1.0)\npredictions = [\n one_hot_poly_predictions,\n cyclic_spline_poly_predictions,\n gbrt_predictions,\n]\nlabels = [\n \"One hot +\\npolynomial kernel\",\n \"Splines +\\npolynomial kernel\",\n \"Gradient Boosted\\nTrees\",\n]\nplot_kinds = [\"actual_vs_predicted\", \"residual_vs_predicted\"]\nfor axis_idx, kind in enumerate(plot_kinds):\n for ax, pred, label in zip(axes[axis_idx], predictions, labels):\n disp = PredictionErrorDisplay.from_predictions(\n y_true=y.iloc[test_0],\n y_pred=pred,\n kind=kind,\n scatter_kwargs={\"alpha\": 0.3},\n ax=ax,\n )\n ax.set_xticks(np.linspace(0, 1, num=5))\n if axis_idx == 0:\n ax.set_yticks(np.linspace(0, 1, num=5))\n ax.legend(\n [\"Best model\", label],\n loc=\"upper center\",\n bbox_to_anchor=(0.5, 1.3),\n ncol=2,\n )\n ax.set_aspect(\"equal\", adjustable=\"box\")\nplt.show()"
708708
]
709709
},
710710
{

dev/_downloads/9fcbbc59ab27a20d07e209a711ac4f50/plot_cyclical_feature_engineering.py

+27-16
Original file line numberDiff line numberDiff line change
@@ -774,29 +774,40 @@ def periodic_spline_transformer(period, n_splines=None, degree=3):
774774
#
775775
# Let us finally get a more quantative look at the prediction errors of those
776776
# three models using the true vs predicted demand scatter plots:
777-
fig, axes = plt.subplots(ncols=3, figsize=(12, 4), sharey=True)
778-
fig.suptitle("Non-linear regression models")
777+
from sklearn.metrics import PredictionErrorDisplay
778+
779+
fig, axes = plt.subplots(nrows=2, ncols=3, figsize=(13, 7), sharex=True, sharey="row")
780+
fig.suptitle("Non-linear regression models", y=1.0)
779781
predictions = [
780782
one_hot_poly_predictions,
781783
cyclic_spline_poly_predictions,
782784
gbrt_predictions,
783785
]
784786
labels = [
785-
"One hot + polynomial kernel",
786-
"Splines + polynomial kernel",
787-
"Gradient Boosted Trees",
787+
"One hot +\npolynomial kernel",
788+
"Splines +\npolynomial kernel",
789+
"Gradient Boosted\nTrees",
788790
]
789-
for ax, pred, label in zip(axes, predictions, labels):
790-
ax.scatter(y.iloc[test_0].values, pred, alpha=0.3, label=label)
791-
ax.plot([0, 1], [0, 1], "--", label="Perfect model")
792-
ax.set(
793-
xlim=(0, 1),
794-
ylim=(0, 1),
795-
xlabel="True demand",
796-
ylabel="Predicted demand",
797-
)
798-
ax.legend()
799-
791+
plot_kinds = ["actual_vs_predicted", "residual_vs_predicted"]
792+
for axis_idx, kind in enumerate(plot_kinds):
793+
for ax, pred, label in zip(axes[axis_idx], predictions, labels):
794+
disp = PredictionErrorDisplay.from_predictions(
795+
y_true=y.iloc[test_0],
796+
y_pred=pred,
797+
kind=kind,
798+
scatter_kwargs={"alpha": 0.3},
799+
ax=ax,
800+
)
801+
ax.set_xticks(np.linspace(0, 1, num=5))
802+
if axis_idx == 0:
803+
ax.set_yticks(np.linspace(0, 1, num=5))
804+
ax.legend(
805+
["Best model", label],
806+
loc="upper center",
807+
bbox_to_anchor=(0.5, 1.3),
808+
ncol=2,
809+
)
810+
ax.set_aspect("equal", adjustable="box")
800811
plt.show()
801812
# %%
802813
# This visualization confirms the conclusions we draw on the previous plot.

dev/_downloads/bcd609cfe29c9da1f51c848e18b89c76/plot_partial_dependence.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@
532532
pdp = partial_dependence(
533533
hgbdt_model, X_train, features=features, kind="average", grid_resolution=10
534534
)
535-
XX, YY = np.meshgrid(pdp["values"][0], pdp["values"][1])
535+
XX, YY = np.meshgrid(pdp["grid_values"][0], pdp["grid_values"][1])
536536
Z = pdp.average[0].T
537537
ax = fig.add_subplot(projection="3d")
538538
fig.add_axes(ax)

dev/_downloads/scikit-learn-docs.zip

75.8 KB
Binary file not shown.
Binary file not shown.
-84 Bytes
114 Bytes
315 Bytes
-24 Bytes
-67 Bytes
-12 Bytes
80 Bytes
171 Bytes
11 Bytes
33 Bytes
107 Bytes
5.38 KB
27 Bytes
-27 Bytes
-100 Bytes
-46 Bytes
-22 Bytes
-150 Bytes
-136 Bytes
-71 Bytes
-146 Bytes
-197 Bytes
100 Bytes
-67 Bytes
-398 Bytes
-25 Bytes
0 Bytes
61 Bytes
1 Byte

dev/_sources/auto_examples/applications/plot_cyclical_feature_engineering.rst.txt

+30-19

dev/_sources/auto_examples/applications/plot_digits_denoising.rst.txt

+1-1

dev/_sources/auto_examples/applications/plot_face_recognition.rst.txt

+4-4

dev/_sources/auto_examples/applications/plot_model_complexity_influence.rst.txt

+15-15

0 commit comments

Comments
 (0)