@@ -72,13 +72,14 @@ This class is hence suitable for use in the early steps of a
72
72
:class: `sklearn.pipeline.Pipeline `::
73
73
74
74
>>> scaler = preprocessing.StandardScaler().fit(X)
75
- >>> scaler
76
- StandardScaler(copy=True, with_mean=True, with_std=True)
75
+ >>> scaler # doctest: +NORMALIZE_WHITESPACE
76
+ StandardScaler(axis=0, copy=True, with_centering=True, with_mean=None,
77
+ with_scaling=True, with_std=None)
77
78
78
- >>> scaler.mean_ # doctest: +ELLIPSIS
79
+ >>> scaler.center_ # doctest: +ELLIPSIS
79
80
array([ 1. ..., 0. ..., 0.33...])
80
81
81
- >>> scaler.std_ # doctest: +ELLIPSIS
82
+ >>> scaler.scale_ # doctest: +ELLIPSIS
82
83
array([ 0.81..., 0.81..., 1.24...])
83
84
84
85
>>> scaler.transform(X) # doctest: +ELLIPSIS
@@ -94,7 +95,7 @@ same way it did on the training set::
94
95
array([[-2.44..., 1.22..., -0.26...]])
95
96
96
97
It is possible to disable either centering or scaling by either
97
- passing ``with_mean =False `` or ``with_std =False `` to the constructor
98
+ passing ``with_centering =False `` or ``with_scaling =False `` to the constructor
98
99
of :class: `StandardScaler `.
99
100
100
101
@@ -132,11 +133,11 @@ applied to be consistent with the transformation performed on the train data::
132
133
It is possible to introspect the scaler attributes to find about the exact
133
134
nature of the transformation learned on the training data::
134
135
135
- >>> min_max_scaler.scale_ # doctest: +ELLIPSIS
136
- array([ 0.5 , 0.5 , 0.33.. .])
136
+ >>> min_max_scaler.scale_ # doctest: +NORMALIZE_WHITESPACE
137
+ array([ 2. , 2. , 3 .])
137
138
138
- >>> min_max_scaler.min_ # doctest: +ELLIPSIS
139
- array([ 0. , 0.5 , 0.33.. .])
139
+ >>> min_max_scaler.center_ # doctest: +ELLIPSIS
140
+ array([ 0., -1., -1 .])
140
141
141
142
If :class: `MinMaxScaler ` is given an explicit ``feature_range=(min, max) `` the
142
143
full formula is::
@@ -526,6 +527,5 @@ similarly.
526
527
527
528
Note that if features have very different scaling or statistical
528
529
properties, :class: `cluster.FeatureAgglomeration ` maye not be able to
529
- capture the links between related features. Using a
530
+ capture the links between related features. Using a
530
531
:class: `preprocessing.StandardScaler ` can be useful in these settings.
531
-
0 commit comments