Skip to content

Commit 7db1015

Browse files
authored
DOC Improve consistency of inverse_transform return name (scikit-learn#31135)
1 parent d51f17b commit 7db1015

File tree

17 files changed

+37
-36
lines changed

17 files changed

+37
-36
lines changed

sklearn/cluster/_feature_agglomeration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def inverse_transform(self, X):
6666
6767
Returns
6868
-------
69-
X : ndarray of shape (n_samples, n_features) or (n_features,)
70-
A vector of size `n_samples` with the values of `Xred` assigned to
69+
X_original : ndarray of shape (n_samples, n_features) or (n_features,)
70+
A vector of size `n_samples` with the values of `X` assigned to
7171
each of the cluster of samples.
7272
"""
7373
check_is_fitted(self)

sklearn/cross_decomposition/_pls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,10 @@ def inverse_transform(self, X, y=None):
419419
420420
Returns
421421
-------
422-
X_reconstructed : ndarray of shape (n_samples, n_features)
422+
X_original : ndarray of shape (n_samples, n_features)
423423
Return the reconstructed `X` data.
424424
425-
y_reconstructed : ndarray of shape (n_samples, n_targets)
425+
y_original : ndarray of shape (n_samples, n_targets)
426426
Return the reconstructed `X` target. Only returned when `y` is given.
427427
428428
Notes

sklearn/decomposition/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def inverse_transform(self, X):
177177
178178
Returns
179179
-------
180-
X_original array-like of shape (n_samples, n_features)
180+
X_original : array-like of shape (n_samples, n_features)
181181
Original data, where `n_samples` is the number of samples
182182
and `n_features` is the number of features.
183183

sklearn/decomposition/_dict_learning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ def inverse_transform(self, X):
11741174
11751175
Returns
11761176
-------
1177-
X_new : ndarray of shape (n_samples, n_features)
1177+
X_original : ndarray of shape (n_samples, n_features)
11781178
Transformed data.
11791179
"""
11801180
check_is_fitted(self)
@@ -1378,7 +1378,7 @@ def inverse_transform(self, X):
13781378
13791379
Returns
13801380
-------
1381-
X_new : ndarray of shape (n_samples, n_features)
1381+
X_original : ndarray of shape (n_samples, n_features)
13821382
Transformed data.
13831383
"""
13841384
return self._inverse_transform(X, self.dictionary)

sklearn/decomposition/_fastica.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ def inverse_transform(self, X, copy=True):
781781
782782
Returns
783783
-------
784-
X_new : ndarray of shape (n_samples, n_features)
784+
X_original : ndarray of shape (n_samples, n_features)
785785
Reconstructed data obtained with the mixing matrix.
786786
"""
787787
check_is_fitted(self)

sklearn/decomposition/_kernel_pca.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ def inverse_transform(self, X):
544544
545545
Returns
546546
-------
547-
X_new : ndarray of shape (n_samples, n_features)
547+
X_original : ndarray of shape (n_samples, n_features)
548548
Returns the instance itself.
549549
550550
References

sklearn/decomposition/_nmf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ def inverse_transform(self, X):
13021302
13031303
Returns
13041304
-------
1305-
X : ndarray of shape (n_samples, n_features)
1305+
X_original : ndarray of shape (n_samples, n_features)
13061306
Returns a data matrix of the original shape.
13071307
"""
13081308

sklearn/feature_extraction/_dict_vectorizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def inverse_transform(self, X, dict_type=dict):
339339
340340
Returns
341341
-------
342-
D : list of dict_type objects of shape (n_samples,)
342+
X_original : list of dict_type objects of shape (n_samples,)
343343
Feature mappings for the samples in X.
344344
"""
345345
check_is_fitted(self, "feature_names_")

sklearn/feature_extraction/text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,7 @@ def inverse_transform(self, X):
14331433
14341434
Returns
14351435
-------
1436-
X_inv : list of arrays of shape (n_samples,)
1436+
X_original : list of arrays of shape (n_samples,)
14371437
List of arrays of terms.
14381438
"""
14391439
self._check_vocabulary()

sklearn/feature_selection/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def inverse_transform(self, X):
141141
142142
Returns
143143
-------
144-
X_r : array of shape [n_samples, n_original_features]
144+
X_original : array of shape [n_samples, n_original_features]
145145
`X` with columns of zeros inserted where features would have
146146
been removed by :meth:`transform`.
147147
"""

0 commit comments

Comments
 (0)