Skip to content

Commit 4c6ad90

Browse files
committed
Remove interquartile_scale parameter
1 parent dd2fdbb commit 4c6ad90

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

sklearn/preprocessing/data.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,6 @@ class RobustScaler(BaseEstimator, TransformerMixin):
420420
421421
Parameters
422422
----------
423-
interquartile_scale : float or string in ["normal" (default), ],
424-
The interquartile range is divided by this factor. If
425-
`interquartile_scale` is "normal", the data is scaled so it
426-
approximately reaches unit variance. This convergence assumes
427-
Gaussian input data and will need a large number of samples.
428-
429423
with_centering : boolean, True by default
430424
If True, center the data before scaling.
431425
This does not work (and will raise an exception) when attempted on
@@ -467,9 +461,7 @@ class RobustScaler(BaseEstimator, TransformerMixin):
467461
http://en.wikipedia.org/wiki/Interquartile_range
468462
"""
469463

470-
def __init__(self, interquartile_scale="normal", with_centering=True,
471-
with_scaling=True, copy=True):
472-
self.interquartile_scale = interquartile_scale
464+
def __init__(self, with_centering=True, with_scaling=True, copy=True):
473465
self.with_centering = with_centering
474466
self.with_scaling = with_scaling
475467
self.copy = copy
@@ -510,21 +502,13 @@ def fit(self, X, y=None):
510502
if sparse.issparse(X):
511503
raise TypeError("RobustScaler cannot be fitted on sparse inputs")
512504

513-
if not np.isreal(self.interquartile_scale):
514-
if self.interquartile_scale != "normal":
515-
raise ValueError("Unknown interquartile_scale value.")
516-
else:
517-
iqr_scale = 1.34898
518-
else:
519-
iqr_scale = self.interquartile_scale
520-
521505
X = self._check_array(X, self.copy)
522506
if self.with_centering:
523507
self.center_ = np.median(X, axis=0)
524508

525509
if self.with_scaling:
526510
q = np.percentile(X, (25, 75), axis=0)
527-
self.scale_ = (q[1] - q[0]) / iqr_scale
511+
self.scale_ = (q[1] - q[0])
528512
if np.isscalar(self.scale_):
529513
if self.scale_ == 0:
530514
self.scale_ = 1.

0 commit comments

Comments
 (0)