Skip to content

Commit f597c27

Browse files
committed
Pushing the docs to dev/ for branch: master, commit ee2508ce45fd7d491b25e354509cda26c14b16ec
1 parent f6e96bc commit f597c27

File tree

1,212 files changed

+4451
-3870
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,212 files changed

+4451
-3870
lines changed
Binary file not shown.

dev/_downloads/b5a4a1546e908b944c14370f9e7e2a25/plot_column_transformer_mixed_types.ipynb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,24 @@
4747
"numeric_features = ['age', 'fare']\nnumeric_transformer = Pipeline(steps=[\n ('imputer', SimpleImputer(strategy='median')),\n ('scaler', StandardScaler())])\n\ncategorical_features = ['embarked', 'sex', 'pclass']\ncategorical_transformer = Pipeline(steps=[\n ('imputer', SimpleImputer(strategy='constant', fill_value='missing')),\n ('onehot', OneHotEncoder(handle_unknown='ignore'))])\n\npreprocessor = ColumnTransformer(\n transformers=[\n ('num', numeric_transformer, numeric_features),\n ('cat', categorical_transformer, categorical_features)])\n\n# Append classifier to preprocessing pipeline.\n# Now we have a full prediction pipeline.\nclf = Pipeline(steps=[('preprocessor', preprocessor),\n ('classifier', LogisticRegression())])\n\nX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)\n\nclf.fit(X_train, y_train)\nprint(\"model score: %.3f\" % clf.score(X_test, y_test))"
4848
]
4949
},
50+
{
51+
"cell_type": "markdown",
52+
"metadata": {},
53+
"source": [
54+
"HTML representation of ``Pipeline``\n##############################################################################\n When the ``Pipeline`` is printed out in a jupyter notebook an HTML\n representation of the estimator is displayed as follows:\n\n"
55+
]
56+
},
57+
{
58+
"cell_type": "code",
59+
"execution_count": null,
60+
"metadata": {
61+
"collapsed": false
62+
},
63+
"outputs": [],
64+
"source": [
65+
"from sklearn import set_config\nset_config(display='diagram')\nclf"
66+
]
67+
},
5068
{
5169
"cell_type": "markdown",
5270
"metadata": {},
Binary file not shown.

dev/_downloads/ec7916875965bf7f54b7cfe8e6dc4cc2/plot_column_transformer_mixed_types.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@
8787
clf.fit(X_train, y_train)
8888
print("model score: %.3f" % clf.score(X_test, y_test))
8989

90+
##############################################################################
91+
# HTML representation of ``Pipeline``
92+
###############################################################################
93+
# When the ``Pipeline`` is printed out in a jupyter notebook an HTML
94+
# representation of the estimator is displayed as follows:
95+
from sklearn import set_config
96+
set_config(display='diagram')
97+
clf
98+
9099
###############################################################################
91100
# Use ``ColumnTransformer`` by selecting column by data types
92101
###############################################################################

dev/_downloads/scikit-learn-docs.pdf

-15.5 KB
Binary file not shown.

dev/_images/iris.png

0 Bytes
93 Bytes
93 Bytes
86 Bytes
86 Bytes

0 commit comments

Comments
 (0)