@@ -335,7 +335,7 @@ def fit(self, X, y=None):
335335 X , axis = 0 , with_mean = self .with_mean , with_std = self .with_std )
336336 return self
337337
338- def transform (self , X , y = None , copy = None ):
338+ def transform (self , X , y = None ):
339339 """Perform standardization by centering and scaling
340340
341341 Parameters
@@ -345,8 +345,8 @@ def transform(self, X, y=None, copy=None):
345345 """
346346 check_is_fitted (self , 'std_' )
347347
348- copy = copy if copy is not None else self .copy
349- X = check_array ( X , accept_sparse = 'csr' , copy = copy , ensure_2d = False )
348+ X = check_array ( X , accept_sparse = 'csr' , copy = self .copy ,
349+ ensure_2d = False )
350350 if warn_if_not_float (X , estimator = self ):
351351 X = X .astype (np .float )
352352 if sparse .issparse (X ):
@@ -363,7 +363,7 @@ def transform(self, X, y=None, copy=None):
363363 X /= self .std_
364364 return X
365365
366- def inverse_transform (self , X , copy = None ):
366+ def inverse_transform (self , X ):
367367 """Scale back the data to the original representation
368368
369369 Parameters
@@ -373,7 +373,6 @@ def inverse_transform(self, X, copy=None):
373373 """
374374 check_is_fitted (self , 'std_' )
375375
376- copy = copy if copy is not None else self .copy
377376 if sparse .issparse (X ):
378377 if self .with_mean :
379378 raise ValueError (
@@ -382,13 +381,13 @@ def inverse_transform(self, X, copy=None):
382381 if not sparse .isspmatrix_csr (X ):
383382 X = X .tocsr ()
384383 copy = False
385- if copy :
384+ if self . copy :
386385 X = X .copy ()
387386 if self .std_ is not None :
388387 inplace_column_scale (X , self .std_ )
389388 else :
390389 X = np .asarray (X )
391- if copy :
390+ if self . copy :
392391 X = X .copy ()
393392 if self .with_std :
394393 X *= self .std_
@@ -507,10 +506,7 @@ def fit(self, X, y=None):
507506 else :
508507 iqr_scale = self .interquartile_scale
509508
510- if copy is None :
511- copy = self .copy
512-
513- X = self ._check_array (X , copy )
509+ X = self ._check_array (X , self .copy )
514510 if self .with_centering :
515511 self .center_ = np .median (X , axis = 0 )
516512
0 commit comments