class_docstr: Replaces outliers in data with NaN.
  Outliers are determined by z-score cutoff. Columns are handled independently.
  
  Parameters
  ----------
  z_cutoff : `float` or None, default None
      z-score cutoff to define outliers. If None, this transformer is a no-op.
  use_fit_baseline : `bool`, default False
      If True, the z-scores are calculated using the mean and standard
      deviation of the dataset passed to ``fit``.
  
      If False, the transformer is stateless. z-scores are calculated
      for the dataset passed to ``transform``, regardless of ``fit``.
  
  Attributes
  ----------
  mean : `pandas.Series`
      Mean of each column. NaNs are ignored.
  std : `pandas.Series`
      Standard deviation of each column. NaNs are ignored.
  _is_fitted : `bool`
      Whether the transformer is fitted.
class_docstr_tok: ["Replaces","outliers","in","data","with","NaN",".","Outliers","are","determined","by","z-score","cutoff",".","Columns","are","handled","independently",".","Parameters","--","--","--","--","--","z_cutoff",":","`","float","`","or","None",",","default","None","z-score","cutoff","to","define","outliers",".","If","None",",","this","transformer","is","a","no-op",".","use_fit_baseline",":","`","bool","`",",","default","False","If","True",",","the","z-scores","are","calculated","using","the","mean","and","standard","deviation","of","the","dataset","passed","to","``","fit","``",".","If","False",",","the","transformer","is","stateless",".","z-scores","are","calculated","for","the","dataset","passed","to","``","transform","``",",","regardless","of","``","fit","``",".","Attributes","--","--","--","--","--","mean",":","`","pandas.Series","`","Mean","of","each","column",".","NaNs","are","ignored",".","std",":","`","pandas.Series","`","Standard","deviation","of","each","column",".","NaNs","are","ignored",".","_is_fitted",":","`","bool","`","Whether","the","transformer","is","fitted","."]
docstr: Replaces outliers with NaN.
  
  Parameters
  ----------
  X : `pandas.DataFrame`
      Data to transform. e.g. each column is a timeseries.
      Columns are expected to be numeric.
  
  Returns
  -------
  X_outlier : `pandas.DataFrame`
      A copy of the data frame with original values and outliers replaced with NaN.
docstr_tok: ["Replaces","outliers","with","NaN",".","Parameters","--","--","--","--","--","X",":","`","pandas.DataFrame","`","Data","to","transform",".","e.g",".","each","column","is","a","timeseries",".","Columns","are","expected","to","be","numeric",".","Returns","--","--","--","-","X_outlier",":","`","pandas.DataFrame","`","A","copy","of","the","data","frame","with","original","values","and","outliers","replaced","with","NaN","."]
code: def transform(self, X):
      """Replaces outliers with NaN.
  
      Parameters
      ----------
      X : `pandas.DataFrame`
          Data to transform. e.g. each column is a timeseries.
          Columns are expected to be numeric.
  
      Returns
      -------
      X_outlier : `pandas.DataFrame`
          A copy of the data frame with original values and outliers replaced with NaN.
      """
      assert isinstance(X, pd.DataFrame)
      result = X.copy()
      if self.z_cutoff is not None:
          if self.use_fit_baseline:
              if self._is_fitted is None:
                  raise NotFittedError(
                      "This instance is not fitted yet. Call 'fit' with appropriate arguments "
                      "before calling 'transform'."
                  )
              mean = self.mean
              std = self.std
          else:
              mean = X.mean()
              std = X.std()
          outlier_indices = np.abs(X - mean) > std * self.z_cutoff
          if np.any(outlier_indices):
              total_na = outlier_indices.sum().sum()
              log_message(
                  f"Detected {total_na} outlier(s).",
                  LoggingLevelEnum.INFO,
              )
          result = result.mask(outlier_indices)
      return result
  
file_path: greykite/greykite/sklearn/transform/zscore_outlier_transformer.py
imports: import numpy
  import pandas
  from sklearn.base import BaseEstimator
  from sklearn.base import TransformerMixin
  from sklearn.exceptions import NotFittedError
  from greykite.common.logging import LoggingLevelEnum
  from greykite.common.logging import log_message
label_desc: Use image node_id 3 for calling the ZscoreOutlierTransformer obj's underlying member method code with example usage: obj.transform(X) and returns: result