Skip to content

Commit b16cdf0

Browse files
committed
Pushing the docs to dev/ for branch: main, commit 36375c3ebf6438a46949c45bc8b3d8ecdcb19301
1 parent c776e4a commit b16cdf0

File tree

1,262 files changed

+6028
-6052
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,262 files changed

+6028
-6052
lines changed
Binary file not shown.
Binary file not shown.

dev/_downloads/c3a0ceabf65f8c894895af414e685ee9/plot_adaboost_twoclass.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"outputs": [],
1717
"source": [
18-
"# Author: Noel Dawe <[email protected]>\n#\n# License: BSD 3 clause\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom sklearn.datasets import make_gaussian_quantiles\nfrom sklearn.ensemble import AdaBoostClassifier\nfrom sklearn.inspection import DecisionBoundaryDisplay\nfrom sklearn.tree import DecisionTreeClassifier\n\n# Construct dataset\nX1, y1 = make_gaussian_quantiles(\n cov=2.0, n_samples=200, n_features=2, n_classes=2, random_state=1\n)\nX2, y2 = make_gaussian_quantiles(\n mean=(3, 3), cov=1.5, n_samples=300, n_features=2, n_classes=2, random_state=1\n)\nX = np.concatenate((X1, X2))\ny = np.concatenate((y1, -y2 + 1))\n\n# Create and fit an AdaBoosted decision tree\nbdt = AdaBoostClassifier(\n DecisionTreeClassifier(max_depth=1), algorithm=\"SAMME\", n_estimators=200\n)\n\nbdt.fit(X, y)\n\nplot_colors = \"br\"\nplot_step = 0.02\nclass_names = \"AB\"\n\nplt.figure(figsize=(10, 5))\n\n# Plot the decision boundaries\nax = plt.subplot(121)\ndisp = DecisionBoundaryDisplay.from_estimator(\n bdt,\n X,\n cmap=plt.cm.Paired,\n response_method=\"predict\",\n ax=ax,\n xlabel=\"x\",\n ylabel=\"y\",\n)\nx_min, x_max = disp.xx0.min(), disp.xx0.max()\ny_min, y_max = disp.xx1.min(), disp.xx1.max()\nplt.axis(\"tight\")\n\n# Plot the training points\nfor i, n, c in zip(range(2), class_names, plot_colors):\n idx = np.where(y == i)\n plt.scatter(\n X[idx, 0],\n X[idx, 1],\n c=c,\n cmap=plt.cm.Paired,\n s=20,\n edgecolor=\"k\",\n label=\"Class %s\" % n,\n )\nplt.xlim(x_min, x_max)\nplt.ylim(y_min, y_max)\nplt.legend(loc=\"upper right\")\n\nplt.title(\"Decision Boundary\")\n\n# Plot the two-class decision scores\ntwoclass_output = bdt.decision_function(X)\nplot_range = (twoclass_output.min(), twoclass_output.max())\nplt.subplot(122)\nfor i, n, c in zip(range(2), class_names, plot_colors):\n plt.hist(\n twoclass_output[y == i],\n bins=10,\n range=plot_range,\n facecolor=c,\n label=\"Class %s\" % n,\n alpha=0.5,\n edgecolor=\"k\",\n )\nx1, x2, y1, y2 = plt.axis()\nplt.axis((x1, x2, y1, y2 * 1.2))\nplt.legend(loc=\"upper right\")\nplt.ylabel(\"Samples\")\nplt.xlabel(\"Score\")\nplt.title(\"Decision Scores\")\n\nplt.tight_layout()\nplt.subplots_adjust(wspace=0.35)\nplt.show()"
18+
"# Author: Noel Dawe <[email protected]>\n#\n# License: BSD 3 clause\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom sklearn.datasets import make_gaussian_quantiles\nfrom sklearn.ensemble import AdaBoostClassifier\nfrom sklearn.inspection import DecisionBoundaryDisplay\nfrom sklearn.tree import DecisionTreeClassifier\n\n# Construct dataset\nX1, y1 = make_gaussian_quantiles(\n cov=2.0, n_samples=200, n_features=2, n_classes=2, random_state=1\n)\nX2, y2 = make_gaussian_quantiles(\n mean=(3, 3), cov=1.5, n_samples=300, n_features=2, n_classes=2, random_state=1\n)\nX = np.concatenate((X1, X2))\ny = np.concatenate((y1, -y2 + 1))\n\n# Create and fit an AdaBoosted decision tree\nbdt = AdaBoostClassifier(\n DecisionTreeClassifier(max_depth=1), algorithm=\"SAMME\", n_estimators=200\n)\n\nbdt.fit(X, y)\n\nplot_colors = \"br\"\nplot_step = 0.02\nclass_names = \"AB\"\n\nplt.figure(figsize=(10, 5))\n\n# Plot the decision boundaries\nax = plt.subplot(121)\ndisp = DecisionBoundaryDisplay.from_estimator(\n bdt,\n X,\n cmap=plt.cm.Paired,\n response_method=\"predict\",\n ax=ax,\n xlabel=\"x\",\n ylabel=\"y\",\n)\nx_min, x_max = disp.xx0.min(), disp.xx0.max()\ny_min, y_max = disp.xx1.min(), disp.xx1.max()\nplt.axis(\"tight\")\n\n# Plot the training points\nfor i, n, c in zip(range(2), class_names, plot_colors):\n idx = np.where(y == i)\n plt.scatter(\n X[idx, 0],\n X[idx, 1],\n c=c,\n s=20,\n edgecolor=\"k\",\n label=\"Class %s\" % n,\n )\nplt.xlim(x_min, x_max)\nplt.ylim(y_min, y_max)\nplt.legend(loc=\"upper right\")\n\nplt.title(\"Decision Boundary\")\n\n# Plot the two-class decision scores\ntwoclass_output = bdt.decision_function(X)\nplot_range = (twoclass_output.min(), twoclass_output.max())\nplt.subplot(122)\nfor i, n, c in zip(range(2), class_names, plot_colors):\n plt.hist(\n twoclass_output[y == i],\n bins=10,\n range=plot_range,\n facecolor=c,\n label=\"Class %s\" % n,\n alpha=0.5,\n edgecolor=\"k\",\n )\nx1, x2, y1, y2 = plt.axis()\nplt.axis((x1, x2, y1, y2 * 1.2))\nplt.legend(loc=\"upper right\")\nplt.ylabel(\"Samples\")\nplt.xlabel(\"Score\")\nplt.title(\"Decision Scores\")\n\nplt.tight_layout()\nplt.subplots_adjust(wspace=0.35)\nplt.show()"
1919
]
2020
}
2121
],

dev/_downloads/f0440afe8f6b99019c4fd181a9f57c59/plot_adaboost_twoclass.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
X[idx, 0],
7575
X[idx, 1],
7676
c=c,
77-
cmap=plt.cm.Paired,
7877
s=20,
7978
edgecolor="k",
8079
label="Class %s" % n,

dev/_downloads/scikit-learn-docs.zip

-13.3 KB
Binary file not shown.
-184 Bytes
-85 Bytes
-124 Bytes
-82 Bytes
120 Bytes
8 Bytes
848 Bytes
196 Bytes
-28 Bytes
-110 Bytes
-124 Bytes
201 Bytes
-3.09 KB
-8.15 KB
-619 Bytes
74 Bytes
19 Bytes
-94 Bytes
-62 Bytes
-48 Bytes
-21 Bytes
99 Bytes
54 Bytes
-64 Bytes
-114 Bytes
-12 Bytes
-516 Bytes
-79 Bytes
-429 Bytes
236 Bytes
-92 Bytes
39 Bytes

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

Lines changed: 1 addition & 1 deletion

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

Lines changed: 1 addition & 1 deletion

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

Lines changed: 4 additions & 4 deletions

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

Lines changed: 15 additions & 15 deletions

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

Lines changed: 29 additions & 29 deletions

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

Lines changed: 1 addition & 1 deletion

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

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)