Skip to content

Commit fc6a4b3

Browse files
committed
Pushing the docs to dev/ for branch: main, commit 4bcd6ea976a485f479ab4a329f8ea06f3615dca3
1 parent aef1e69 commit fc6a4b3

File tree

1,302 files changed

+5969
-5757
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,302 files changed

+5969
-5757
lines changed

dev/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: a42bb7a3aa546e8e74c975ecf23d7839
3+
config: 2395bb72786bda0d07b08b4066341e5a
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file not shown.

dev/_downloads/35686e86ab04c9899b73acd07be52bc7/plot_metadata_routing.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,17 @@ def transform(self, X, groups=None):
492492
check_metadata(self, groups=groups)
493493
return X
494494

495+
def fit_transform(self, X, y, sample_weight=None, groups=None):
496+
return self.fit(X, y, sample_weight).transform(X, groups)
497+
495498

496499
# %%
500+
# Note that in the above example, we have implemented ``fit_transform`` which
501+
# calls ``fit`` and ``transform`` with the appropriate metadata. This is only
502+
# required if ``transform`` accepts metadata, since the default ``fit_transform``
503+
# implementation in :class:`~base.TransformerMixin` doesn't pass metadata to
504+
# ``transform``.
505+
#
497506
# Now we can test our pipeline, and see if metadata is correctly passed around.
498507
# This example uses our simple pipeline, and our transformer, and our
499508
# consumer+router estimator which uses our simple classifier.

dev/_downloads/64a4ce2171987c74f955483a03ac45b5/plot_metadata_routing.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,14 +497,14 @@
497497
},
498498
"outputs": [],
499499
"source": [
500-
"class ExampleTransformer(TransformerMixin, BaseEstimator):\n def fit(self, X, y, sample_weight=None):\n check_metadata(self, sample_weight=sample_weight)\n return self\n\n def transform(self, X, groups=None):\n check_metadata(self, groups=groups)\n return X"
500+
"class ExampleTransformer(TransformerMixin, BaseEstimator):\n def fit(self, X, y, sample_weight=None):\n check_metadata(self, sample_weight=sample_weight)\n return self\n\n def transform(self, X, groups=None):\n check_metadata(self, groups=groups)\n return X\n\n def fit_transform(self, X, y, sample_weight=None, groups=None):\n return self.fit(X, y, sample_weight).transform(X, groups)"
501501
]
502502
},
503503
{
504504
"cell_type": "markdown",
505505
"metadata": {},
506506
"source": [
507-
"Now we can test our pipeline, and see if metadata is correctly passed around.\nThis example uses our simple pipeline, and our transformer, and our\nconsumer+router estimator which uses our simple classifier.\n\n"
507+
"Note that in the above example, we have implemented ``fit_transform`` which\ncalls ``fit`` and ``transform`` with the appropriate metadata. This is only\nrequired if ``transform`` accepts metadata, since the default ``fit_transform``\nimplementation in :class:`~base.TransformerMixin` doesn't pass metadata to\n``transform``.\n\nNow we can test our pipeline, and see if metadata is correctly passed around.\nThis example uses our simple pipeline, and our transformer, and our\nconsumer+router estimator which uses our simple classifier.\n\n"
508508
]
509509
},
510510
{
Binary file not shown.

dev/_downloads/scikit-learn-docs.zip

2.92 KB
Binary file not shown.

0 commit comments

Comments
 (0)