From ac3c8f4e25c29d5bb8a3c223495e29f1db887b7b Mon Sep 17 00:00:00 2001 From: rprkh Date: Sun, 6 Nov 2022 23:10:12 +0530 Subject: [PATCH 1/8] improve X doc in FunctionTransformer.transform --- sklearn/preprocessing/_function_transformer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn/preprocessing/_function_transformer.py b/sklearn/preprocessing/_function_transformer.py index d4c2cf6de7af2..9d62b3bc6905d 100644 --- a/sklearn/preprocessing/_function_transformer.py +++ b/sklearn/preprocessing/_function_transformer.py @@ -218,7 +218,7 @@ def transform(self, X): Parameters ---------- - X : array-like, shape (n_samples, n_features) + X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) if `validate`=True else Iterable Input array. Returns From 5b21c43eaff37348a1f69e6b27654c8e778f85ba Mon Sep 17 00:00:00 2001 From: rprkh Date: Sun, 6 Nov 2022 23:28:00 +0530 Subject: [PATCH 2/8] lint: --- sklearn/preprocessing/_function_transformer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sklearn/preprocessing/_function_transformer.py b/sklearn/preprocessing/_function_transformer.py index 9d62b3bc6905d..bd8c54ddf9286 100644 --- a/sklearn/preprocessing/_function_transformer.py +++ b/sklearn/preprocessing/_function_transformer.py @@ -218,7 +218,8 @@ def transform(self, X): Parameters ---------- - X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) if `validate`=True else Iterable + X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) \ + if `validate`=True else Iterable Input array. Returns From 31c195604bb512ef2a8187a1cd2d519936ed2623 Mon Sep 17 00:00:00 2001 From: rprkh Date: Sun, 6 Nov 2022 23:43:50 +0530 Subject: [PATCH 3/8] fix doc error --- sklearn/preprocessing/_function_transformer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn/preprocessing/_function_transformer.py b/sklearn/preprocessing/_function_transformer.py index bd8c54ddf9286..2a8435c7ca349 100644 --- a/sklearn/preprocessing/_function_transformer.py +++ b/sklearn/preprocessing/_function_transformer.py @@ -219,7 +219,7 @@ def transform(self, X): Parameters ---------- X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) \ - if `validate`=True else Iterable + if validate=True else Iterable Input array. Returns From 406605c18b52a1b56040b5069a593e163a253d78 Mon Sep 17 00:00:00 2001 From: Ruben Parikh Date: Tue, 8 Nov 2022 12:55:33 +0530 Subject: [PATCH 4/8] update description of X in fit and inverse_transform --- sklearn/preprocessing/_function_transformer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sklearn/preprocessing/_function_transformer.py b/sklearn/preprocessing/_function_transformer.py index 2a8435c7ca349..bf67de6172307 100644 --- a/sklearn/preprocessing/_function_transformer.py +++ b/sklearn/preprocessing/_function_transformer.py @@ -196,7 +196,8 @@ def fit(self, X, y=None): Parameters ---------- - X : array-like, shape (n_samples, n_features) + X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) \ + if validate=True else Iterable Input array. y : Ignored @@ -235,7 +236,8 @@ def inverse_transform(self, X): Parameters ---------- - X : array-like, shape (n_samples, n_features) + X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) \ + if validate=True else Iterable Input array. Returns From a1ee425e0996b7b0685381e1286ee682726829a5 Mon Sep 17 00:00:00 2001 From: rprkh Date: Sat, 3 Dec 2022 16:30:26 +0530 Subject: [PATCH 5/8] include suggestion --- sklearn/preprocessing/_function_transformer.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sklearn/preprocessing/_function_transformer.py b/sklearn/preprocessing/_function_transformer.py index 2a8435c7ca349..57bdf2dc7685b 100644 --- a/sklearn/preprocessing/_function_transformer.py +++ b/sklearn/preprocessing/_function_transformer.py @@ -196,7 +196,8 @@ def fit(self, X, y=None): Parameters ---------- - X : array-like, shape (n_samples, n_features) + X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) \ + if validate=True else any object that ``func`` can handle. Input array. y : Ignored @@ -218,8 +219,8 @@ def transform(self, X): Parameters ---------- - X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) \ - if validate=True else Iterable + X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) \ + if validate=True else any object that ``func`` can handle. Input array. Returns @@ -235,7 +236,8 @@ def inverse_transform(self, X): Parameters ---------- - X : array-like, shape (n_samples, n_features) + X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) \ + if validate=True else any object that ``func`` can handle. Input array. Returns From fb4dde3d7edfed6ad2857cd94f8d5dff9fa284db Mon Sep 17 00:00:00 2001 From: rprkh Date: Sat, 3 Dec 2022 18:35:44 +0530 Subject: [PATCH 6/8] update --- sklearn/preprocessing/_function_transformer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sklearn/preprocessing/_function_transformer.py b/sklearn/preprocessing/_function_transformer.py index 57bdf2dc7685b..a5f5fff42a21c 100644 --- a/sklearn/preprocessing/_function_transformer.py +++ b/sklearn/preprocessing/_function_transformer.py @@ -197,7 +197,7 @@ def fit(self, X, y=None): Parameters ---------- X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) \ - if validate=True else any object that ``func`` can handle. + if validate=True else any object that ``func`` can handle Input array. y : Ignored @@ -220,7 +220,7 @@ def transform(self, X): Parameters ---------- X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) \ - if validate=True else any object that ``func`` can handle. + if validate=True else any object that ``func`` can handle Input array. Returns @@ -237,7 +237,7 @@ def inverse_transform(self, X): Parameters ---------- X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) \ - if validate=True else any object that ``func`` can handle. + if validate=True else any object that ``func`` can handle Input array. Returns From 18cad10313460770eff38f836de12d4165b3abf6 Mon Sep 17 00:00:00 2001 From: rprkh Date: Wed, 7 Dec 2022 10:19:49 +0530 Subject: [PATCH 7/8] change func to inverse_func --- sklearn/preprocessing/_function_transformer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn/preprocessing/_function_transformer.py b/sklearn/preprocessing/_function_transformer.py index a5f5fff42a21c..e484c69a460e7 100644 --- a/sklearn/preprocessing/_function_transformer.py +++ b/sklearn/preprocessing/_function_transformer.py @@ -237,7 +237,7 @@ def inverse_transform(self, X): Parameters ---------- X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) \ - if validate=True else any object that ``func`` can handle + if validate=True else any object that ``inverse_func`` can handle Input array. Returns From 4690b002730b64235a09f541da82619c6bc0192e Mon Sep 17 00:00:00 2001 From: rprkh Date: Fri, 30 Dec 2022 16:24:40 +0530 Subject: [PATCH 8/8] changes --- sklearn/preprocessing/_function_transformer.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sklearn/preprocessing/_function_transformer.py b/sklearn/preprocessing/_function_transformer.py index e484c69a460e7..d114567e2e11b 100644 --- a/sklearn/preprocessing/_function_transformer.py +++ b/sklearn/preprocessing/_function_transformer.py @@ -196,8 +196,8 @@ def fit(self, X, y=None): Parameters ---------- - X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) \ - if validate=True else any object that ``func`` can handle + X : {array-like, sparse-matrix} of shape (n_samples, n_features) \ + if `validate=True` else any object that `func` can handle Input array. y : Ignored @@ -219,8 +219,8 @@ def transform(self, X): Parameters ---------- - X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) \ - if validate=True else any object that ``func`` can handle + X : {array-like, sparse-matrix} of shape (n_samples, n_features) \ + if `validate=True` else any object that `func` can handle Input array. Returns @@ -236,8 +236,8 @@ def inverse_transform(self, X): Parameters ---------- - X : {array-like, sparse-matrix, dataframe} of shape (n_samples, n_features) \ - if validate=True else any object that ``inverse_func`` can handle + X : {array-like, sparse-matrix} of shape (n_samples, n_features) \ + if `validate=True` else any object that `inverse_func` can handle Input array. Returns