Skip to content

Commit a7ea940

Browse files
committed
Pushing the docs to dev/ for branch: master, commit b026c4d7c98935c097fa191f4a7ca799160c91d7
1 parent 3e2ebc2 commit a7ea940

File tree

1,238 files changed

+3765
-3705
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,238 files changed

+3765
-3705
lines changed
Binary file not shown.

dev/_downloads/2e6d841155147c9fbce4ea3837b924b9/plot_release_highlights_0_24_0.ipynb

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
},
8484
"outputs": [],
8585
"source": [
86-
"from sklearn.feature_selection import SequentialFeatureSelector\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.datasets import load_iris\n\nX, y = load_iris(return_X_y=True, as_frame=True)\nfeature_names = X.columns\nknn = KNeighborsClassifier(n_neighbors=3)\nsfs = SequentialFeatureSelector(knn, n_features_to_select=2)\nsfs.fit(X, y)\nprint(\"Features selected by forward sequential selection: \"\n f\"{feature_names[sfs.get_support().tolist()]}\")"
86+
"from sklearn.feature_selection import SequentialFeatureSelector\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.datasets import load_iris\n\nX, y = load_iris(return_X_y=True, as_frame=True)\nfeature_names = X.columns\nknn = KNeighborsClassifier(n_neighbors=3)\nsfs = SequentialFeatureSelector(knn, n_features_to_select=2)\nsfs.fit(X, y)\nprint(\"Features selected by forward sequential selection: \"\n f\"{feature_names[sfs.get_support()].tolist()}\")"
8787
]
8888
},
8989
{
@@ -101,7 +101,25 @@
101101
},
102102
"outputs": [],
103103
"source": [
104-
"from sklearn.datasets import fetch_covtype\nfrom sklearn.pipeline import make_pipeline\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.kernel_approximation import PolynomialCountSketch\nfrom sklearn.linear_model import LogisticRegression\n\nX, y = fetch_covtype(return_X_y=True)\npipe = make_pipeline(MinMaxScaler(),\n PolynomialCountSketch(degree=2, n_components=300),\n LogisticRegression(max_iter=1000))\nX_train, X_test, y_train, y_test = train_test_split(X, y, train_size=5000,\n test_size=10000,\n random_state=42)\npipe.fit(X_train, y_train).score(X_test, y_test)\n\n# ##############################################################################\n# # For comparison, here is the score of a linear baseline for the same data:\n\nlinear_baseline = make_pipeline(MinMaxScaler(),\n LogisticRegression(max_iter=1000))\nlinear_baseline.fit(X_train, y_train).score(X_test, y_test)"
104+
"from sklearn.datasets import fetch_covtype\nfrom sklearn.pipeline import make_pipeline\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.kernel_approximation import PolynomialCountSketch\nfrom sklearn.linear_model import LogisticRegression\n\nX, y = fetch_covtype(return_X_y=True)\npipe = make_pipeline(MinMaxScaler(),\n PolynomialCountSketch(degree=2, n_components=300),\n LogisticRegression(max_iter=1000))\nX_train, X_test, y_train, y_test = train_test_split(X, y, train_size=5000,\n test_size=10000,\n random_state=42)\npipe.fit(X_train, y_train).score(X_test, y_test)"
105+
]
106+
},
107+
{
108+
"cell_type": "markdown",
109+
"metadata": {},
110+
"source": [
111+
"For comparison, here is the score of a linear baseline for the same data:\n\n"
112+
]
113+
},
114+
{
115+
"cell_type": "code",
116+
"execution_count": null,
117+
"metadata": {
118+
"collapsed": false
119+
},
120+
"outputs": [],
121+
"source": [
122+
"linear_baseline = make_pipeline(MinMaxScaler(),\n LogisticRegression(max_iter=1000))\nlinear_baseline.fit(X_train, y_train).score(X_test, y_test)"
105123
]
106124
},
107125
{
Binary file not shown.

dev/_downloads/d20432c5cccdd8b208184031b83a8cf9/plot_release_highlights_0_24_0.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
sfs = SequentialFeatureSelector(knn, n_features_to_select=2)
147147
sfs.fit(X, y)
148148
print("Features selected by forward sequential selection: "
149-
f"{feature_names[sfs.get_support().tolist()]}")
149+
f"{feature_names[sfs.get_support()].tolist()}")
150150

151151
##############################################################################
152152
# New PolynomialCountSketch kernel approximation function
@@ -172,8 +172,8 @@
172172
random_state=42)
173173
pipe.fit(X_train, y_train).score(X_test, y_test)
174174

175-
# ##############################################################################
176-
# # For comparison, here is the score of a linear baseline for the same data:
175+
##############################################################################
176+
# For comparison, here is the score of a linear baseline for the same data:
177177

178178
linear_baseline = make_pipeline(MinMaxScaler(),
179179
LogisticRegression(max_iter=1000))

dev/_downloads/scikit-learn-docs.pdf

193 Bytes
Binary file not shown.

dev/_images/binder_badge_logo.png

0 Bytes

dev/_images/iris.png

0 Bytes
249 Bytes
249 Bytes
144 Bytes

0 commit comments

Comments
 (0)