paddlets.transform.ksigma
- class KSigma(cols: Union[str, List[str]], k: float = 3.0)[source]
Bases:
BaseTransformThe ksigma method for outlier detection and replacement. It involves:
Calculate the mean (mu) and standard deviation (std) of a column.
Determine the interval of normal data according to mu and std: [mu - k * std, mu + k * std] where k is a hyper-parameter (3.0 by default). Any value of the interval will be considered as an outlier.
Replace the outliers with mu.
- Parameters
cols (str|List[str]) – Column name or Column names (Each column will be handled individually when multiple columns are provided).
k (float) – The hyper-parameter which takes a positive value (3.0 by default).
- Returns
None