Skip to content

Commit a18eea4

Browse files
lesteveglemaitre
authored andcommitted
FIX: FeatureUnion numerically unstable doctest (scikit-learn#11205)
1 parent 41651a1 commit a18eea4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sklearn/pipeline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,12 +644,12 @@ class FeatureUnion(_BaseComposition, TransformerMixin):
644644
--------
645645
>>> from sklearn.pipeline import FeatureUnion
646646
>>> from sklearn.decomposition import PCA, TruncatedSVD
647-
>>> union = FeatureUnion([("pca", PCA(n_components=2)),
647+
>>> union = FeatureUnion([("pca", PCA(n_components=1)),
648648
... ("svd", TruncatedSVD(n_components=2))])
649649
>>> X = [[0., 1., 3], [2., 2., 5]]
650650
>>> union.fit_transform(X) # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
651-
array([[ 1.5 , 0. , 3.0..., 0.8...],
652-
[-1.5 , 0. , 5.7..., -0.4...]])
651+
array([[ 1.5 , 3.0..., 0.8...],
652+
[-1.5 , 5.7..., -0.4...]])
653653
"""
654654
def __init__(self, transformer_list, n_jobs=1, transformer_weights=None):
655655
self.transformer_list = transformer_list

0 commit comments

Comments
 (0)