From a3e6d4319c617f7cf854b79354d23f49bdec6603 Mon Sep 17 00:00:00 2001 From: Harini Sridhar Date: Sat, 2 Nov 2019 11:48:59 -0700 Subject: [PATCH 1/2] Added Sphinx versionadded to TimeSeriesSplit docstring (Issue #15426) --- sklearn/model_selection/_split.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py index 8aa49884f26e3..8c9e63712597d 100644 --- a/sklearn/model_selection/_split.py +++ b/sklearn/model_selection/_split.py @@ -784,6 +784,8 @@ class TimeSeriesSplit(_BaseKFold): + n_samples % (n_splits + 1)`` in the ``i``th split, with a test set of size ``n_samples//(n_splits + 1)``, where ``n_samples`` is the number of samples. + + .. versionadded:: 0.18 """ def __init__(self, n_splits=5, max_train_size=None): super().__init__(n_splits, shuffle=False, random_state=None) From baccef5859f6ea461cd84a652b8c32b24094ea37 Mon Sep 17 00:00:00 2001 From: Harini Sridhar Date: Sat, 2 Nov 2019 12:52:02 -0700 Subject: [PATCH 2/2] Added Sphinx versionadded to docstrings of PLSCanonical, PLSRegression, PLSSVD, PatchExtractor, Pipeline, PowerTransformer, PredefinedSplit (Issue #15426) --- sklearn/cross_decomposition/_pls.py | 6 ++++++ sklearn/feature_extraction/image.py | 2 ++ sklearn/model_selection/_split.py | 4 ++-- sklearn/pipeline.py | 3 +++ sklearn/preprocessing/_data.py | 2 ++ 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sklearn/cross_decomposition/_pls.py b/sklearn/cross_decomposition/_pls.py index a429872020ad0..09c4b7f16f0d3 100644 --- a/sklearn/cross_decomposition/_pls.py +++ b/sklearn/cross_decomposition/_pls.py @@ -634,6 +634,8 @@ class PLSRegression(_PLS): In french but still a reference: Tenenhaus, M. (1998). La regression PLS: theorie et pratique. Paris: Editions Technic. + + .. versionadded:: 0.8 """ def __init__(self, n_components=2, scale=True, @@ -778,6 +780,8 @@ class PLSCanonical(_PLS): -------- CCA PLSSVD + + .. versionadded:: 0.8 """ def __init__(self, n_components=2, scale=True, algorithm="nipals", @@ -845,6 +849,8 @@ class PLSSVD(TransformerMixin, BaseEstimator): -------- PLSCanonical CCA + + .. versionadded:: 0.8 """ def __init__(self, n_components=2, scale=True, copy=True): diff --git a/sklearn/feature_extraction/image.py b/sklearn/feature_extraction/image.py index 2cec6739e7f98..6ad439c0c6f00 100644 --- a/sklearn/feature_extraction/image.py +++ b/sklearn/feature_extraction/image.py @@ -513,6 +513,8 @@ class PatchExtractor(BaseEstimator): >>> pe_trans = pe.transform(X) >>> print('Patches shape: {}'.format(pe_trans.shape)) Patches shape: (545706, 2, 2) + + .. versionadded:: 0.9 """ def __init__(self, patch_size=None, max_patches=None, random_state=None): diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py index 8c9e63712597d..d4954eeb2ec1f 100644 --- a/sklearn/model_selection/_split.py +++ b/sklearn/model_selection/_split.py @@ -784,8 +784,6 @@ class TimeSeriesSplit(_BaseKFold): + n_samples % (n_splits + 1)`` in the ``i``th split, with a test set of size ``n_samples//(n_splits + 1)``, where ``n_samples`` is the number of samples. - - .. versionadded:: 0.18 """ def __init__(self, n_splits=5, max_train_size=None): super().__init__(n_splits, shuffle=False, random_state=None) @@ -1844,6 +1842,8 @@ class PredefinedSplit(BaseCrossValidator): ... y_train, y_test = y[train_index], y[test_index] TRAIN: [1 2 3] TEST: [0] TRAIN: [0 2] TEST: [1 3] + + .. versionadded:: 0.16 """ def __init__(self, test_fold): diff --git a/sklearn/pipeline.py b/sklearn/pipeline.py index a232a8a7b61fb..14beb6c8ae9a4 100644 --- a/sklearn/pipeline.py +++ b/sklearn/pipeline.py @@ -122,6 +122,9 @@ class Pipeline(_BaseComposition): (1, 10) >>> sub_pipeline.inverse_transform(coef).shape (1, 20) + + .. versionadded:: 0.5 + """ # BaseEstimator interface diff --git a/sklearn/preprocessing/_data.py b/sklearn/preprocessing/_data.py index 72ab1f9b45a57..c2226613c09cb 100644 --- a/sklearn/preprocessing/_data.py +++ b/sklearn/preprocessing/_data.py @@ -2715,6 +2715,8 @@ class PowerTransformer(TransformerMixin, BaseEstimator): .. [2] G.E.P. Box and D.R. Cox, "An Analysis of Transformations", Journal of the Royal Statistical Society B, 26, 211-252 (1964). + + .. versionadded:: 0.19.2 """ def __init__(self, method='yeo-johnson', standardize=True, copy=True): self.method = method