@@ -945,9 +945,9 @@ class RobustScaler(BaseEstimator, TransformerMixin):
945
945
and the 3rd quartile (75th quantile).
946
946
947
947
Centering and scaling happen independently on each feature (or each
948
- sample, depending on the `axis` argument) by computing the relevant
948
+ sample, depending on the `` axis` ` argument) by computing the relevant
949
949
statistics on the samples in the training set. Median and interquartile
950
- range are then stored to be used on later data using the `transform`
950
+ range are then stored to be used on later data using the `` transform` `
951
951
method.
952
952
953
953
Standardization of a dataset is a common requirement for many
@@ -964,7 +964,7 @@ class RobustScaler(BaseEstimator, TransformerMixin):
964
964
----------
965
965
with_centering : boolean, True by default
966
966
If True, center the data before scaling.
967
- This does not work (and will raise an exception) when attempted on
967
+ This will cause ``transform`` to raise an exception when attempted on
968
968
sparse matrices, because centering them entails building a dense
969
969
matrix which in common use cases is likely to be too large to fit in
970
970
memory.
@@ -1059,11 +1059,14 @@ def fit(self, X, y=None):
1059
1059
return self
1060
1060
1061
1061
def transform (self , X ):
1062
- """Center and scale the data
1062
+ """Center and scale the data.
1063
+
1064
+ Can be called on sparse input, provided that ``RobustScaler`` has been
1065
+ fitted to dense input and ``with_centering=False``.
1063
1066
1064
1067
Parameters
1065
1068
----------
1066
- X : array-like
1069
+ X : { array-like, sparse matrix}
1067
1070
The data used to scale along the specified axis.
1068
1071
"""
1069
1072
if self .with_centering :
0 commit comments