Skip to content

Commit 8aacdb6

Browse files
committed
Pushing the docs to dev/ for branch: main, commit 838ca42a132a286a682b9dc4f730c1da18404d04
1 parent 2f79576 commit 8aacdb6

File tree

1,264 files changed

+6118
-6167
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,264 files changed

+6118
-6167
lines changed

dev/_downloads/00ae629d652473137a3905a5e08ea815/plot_iris_dtc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
X[idx, 1],
6767
c=color,
6868
label=iris.target_names[i],
69-
cmap=plt.cm.RdYlBu,
7069
edgecolor="black",
7170
s=15,
7271
)
Binary file not shown.
Binary file not shown.

dev/_downloads/bc4cacb86f284cd0b3913166a69c9fb2/plot_iris_dtc.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"outputs": [],
4242
"source": [
43-
"import matplotlib.pyplot as plt\nimport numpy as np\n\nfrom sklearn.datasets import load_iris\nfrom sklearn.inspection import DecisionBoundaryDisplay\nfrom sklearn.tree import DecisionTreeClassifier\n\n# Parameters\nn_classes = 3\nplot_colors = \"ryb\"\nplot_step = 0.02\n\n\nfor pairidx, pair in enumerate([[0, 1], [0, 2], [0, 3], [1, 2], [1, 3], [2, 3]]):\n # We only take the two corresponding features\n X = iris.data[:, pair]\n y = iris.target\n\n # Train\n clf = DecisionTreeClassifier().fit(X, y)\n\n # Plot the decision boundary\n ax = plt.subplot(2, 3, pairidx + 1)\n plt.tight_layout(h_pad=0.5, w_pad=0.5, pad=2.5)\n DecisionBoundaryDisplay.from_estimator(\n clf,\n X,\n cmap=plt.cm.RdYlBu,\n response_method=\"predict\",\n ax=ax,\n xlabel=iris.feature_names[pair[0]],\n ylabel=iris.feature_names[pair[1]],\n )\n\n # Plot the training points\n for i, color in zip(range(n_classes), plot_colors):\n idx = np.where(y == i)\n plt.scatter(\n X[idx, 0],\n X[idx, 1],\n c=color,\n label=iris.target_names[i],\n cmap=plt.cm.RdYlBu,\n edgecolor=\"black\",\n s=15,\n )\n\nplt.suptitle(\"Decision surface of decision trees trained on pairs of features\")\nplt.legend(loc=\"lower right\", borderpad=0, handletextpad=0)\n_ = plt.axis(\"tight\")"
43+
"import matplotlib.pyplot as plt\nimport numpy as np\n\nfrom sklearn.datasets import load_iris\nfrom sklearn.inspection import DecisionBoundaryDisplay\nfrom sklearn.tree import DecisionTreeClassifier\n\n# Parameters\nn_classes = 3\nplot_colors = \"ryb\"\nplot_step = 0.02\n\n\nfor pairidx, pair in enumerate([[0, 1], [0, 2], [0, 3], [1, 2], [1, 3], [2, 3]]):\n # We only take the two corresponding features\n X = iris.data[:, pair]\n y = iris.target\n\n # Train\n clf = DecisionTreeClassifier().fit(X, y)\n\n # Plot the decision boundary\n ax = plt.subplot(2, 3, pairidx + 1)\n plt.tight_layout(h_pad=0.5, w_pad=0.5, pad=2.5)\n DecisionBoundaryDisplay.from_estimator(\n clf,\n X,\n cmap=plt.cm.RdYlBu,\n response_method=\"predict\",\n ax=ax,\n xlabel=iris.feature_names[pair[0]],\n ylabel=iris.feature_names[pair[1]],\n )\n\n # Plot the training points\n for i, color in zip(range(n_classes), plot_colors):\n idx = np.where(y == i)\n plt.scatter(\n X[idx, 0],\n X[idx, 1],\n c=color,\n label=iris.target_names[i],\n edgecolor=\"black\",\n s=15,\n )\n\nplt.suptitle(\"Decision surface of decision trees trained on pairs of features\")\nplt.legend(loc=\"lower right\", borderpad=0, handletextpad=0)\n_ = plt.axis(\"tight\")"
4444
]
4545
},
4646
{

dev/_downloads/scikit-learn-docs.zip

-1.69 KB
Binary file not shown.

0 commit comments

Comments
 (0)