Skip to content

Commit 92879dc

Browse files
committed
Pushing the docs to dev/ for branch: master, commit 0c84afa5446cd606914a06089950014983d48a57
1 parent 55f3edc commit 92879dc

File tree

1,213 files changed

+3645
-3630
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,213 files changed

+3645
-3630
lines changed
Binary file not shown.

dev/_downloads/7ee55c12f8d3eb1dd8d2005d9dd7b6f1/plot_release_highlights_0_22_0.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,23 @@
100100
# The :func:`inspection.permutation_importance` can be used to get an
101101
# estimate of the importance of each feature, for any fitted estimator:
102102

103+
import numpy as np
104+
import matplotlib.pyplot as plt
105+
from sklearn.datasets import make_classification
103106
from sklearn.ensemble import RandomForestClassifier
104107
from sklearn.inspection import permutation_importance
105108

106109
X, y = make_classification(random_state=0, n_features=5, n_informative=3)
110+
feature_names = np.array([f'x_{i}' for i in range(X.shape[1])])
111+
107112
rf = RandomForestClassifier(random_state=0).fit(X, y)
108113
result = permutation_importance(rf, X, y, n_repeats=10, random_state=0,
109114
n_jobs=-1)
110115

111116
fig, ax = plt.subplots()
112117
sorted_idx = result.importances_mean.argsort()
113118
ax.boxplot(result.importances[sorted_idx].T,
114-
vert=False, labels=range(X.shape[1]))
119+
vert=False, labels=feature_names[sorted_idx])
115120
ax.set_title("Permutation Importance of each feature")
116121
ax.set_ylabel("Features")
117122
fig.tight_layout()

dev/_downloads/c101b602d0b3510ef47dd19d64a4a92b/plot_release_highlights_0_22_0.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
},
7070
"outputs": [],
7171
"source": [
72-
"from sklearn.ensemble import RandomForestClassifier\nfrom sklearn.inspection import permutation_importance\n\nX, y = make_classification(random_state=0, n_features=5, n_informative=3)\nrf = RandomForestClassifier(random_state=0).fit(X, y)\nresult = permutation_importance(rf, X, y, n_repeats=10, random_state=0,\n n_jobs=-1)\n\nfig, ax = plt.subplots()\nsorted_idx = result.importances_mean.argsort()\nax.boxplot(result.importances[sorted_idx].T,\n vert=False, labels=range(X.shape[1]))\nax.set_title(\"Permutation Importance of each feature\")\nax.set_ylabel(\"Features\")\nfig.tight_layout()\nplt.show()"
72+
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.datasets import make_classification\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.inspection import permutation_importance\n\nX, y = make_classification(random_state=0, n_features=5, n_informative=3)\nfeature_names = np.array([f'x_{i}' for i in range(X.shape[1])])\n\nrf = RandomForestClassifier(random_state=0).fit(X, y)\nresult = permutation_importance(rf, X, y, n_repeats=10, random_state=0,\n n_jobs=-1)\n\nfig, ax = plt.subplots()\nsorted_idx = result.importances_mean.argsort()\nax.boxplot(result.importances[sorted_idx].T,\n vert=False, labels=feature_names[sorted_idx])\nax.set_title(\"Permutation Importance of each feature\")\nax.set_ylabel(\"Features\")\nfig.tight_layout()\nplt.show()"
7373
]
7474
},
7575
{
Binary file not shown.

dev/_downloads/scikit-learn-docs.pdf

728 Bytes
Binary file not shown.

dev/_images/iris.png

0 Bytes

0 commit comments

Comments
 (0)