@@ -909,9 +909,9 @@ class RobustScaler(BaseEstimator, TransformerMixin):
909
909
and the 3rd quartile (75th quantile).
910
910
911
911
Centering and scaling happen independently on each feature (or each
912
- sample, depending on the `axis` argument) by computing the relevant
912
+ sample, depending on the `` axis` ` argument) by computing the relevant
913
913
statistics on the samples in the training set. Median and interquartile
914
- range are then stored to be used on later data using the `transform`
914
+ range are then stored to be used on later data using the `` transform` `
915
915
method.
916
916
917
917
Standardization of a dataset is a common requirement for many
@@ -928,7 +928,7 @@ class RobustScaler(BaseEstimator, TransformerMixin):
928
928
----------
929
929
with_centering : boolean, True by default
930
930
If True, center the data before scaling.
931
- This does not work (and will raise an exception) when attempted on
931
+ This will cause ``transform`` to raise an exception when attempted on
932
932
sparse matrices, because centering them entails building a dense
933
933
matrix which in common use cases is likely to be too large to fit in
934
934
memory.
@@ -1023,11 +1023,14 @@ def fit(self, X, y=None):
1023
1023
return self
1024
1024
1025
1025
def transform (self , X ):
1026
- """Center and scale the data
1026
+ """Center and scale the data.
1027
+
1028
+ Can be called on sparse input, provided that ``RobustScaler`` has been
1029
+ fitted to dense input and ``with_centering=False``.
1027
1030
1028
1031
Parameters
1029
1032
----------
1030
- X : array-like
1033
+ X : { array-like, sparse matrix}
1031
1034
The data used to scale along the specified axis.
1032
1035
"""
1033
1036
if self .with_centering :
0 commit comments