ts_shape.events.quality.outlier_detection
¤
Classes:
-
OutlierDetectionEvents
–Processes time series data to detect outliers based on specified statistical methods.
OutlierDetectionEvents
¤
OutlierDetectionEvents(dataframe: DataFrame, value_column: str, event_uuid: str = 'outlier_event', time_threshold: str = '5min')
Bases: Base
Processes time series data to detect outliers based on specified statistical methods.
Parameters:
-
dataframe
¤DataFrame
) –The input time series DataFrame.
-
value_column
¤str
) –The name of the column containing the values for outlier detection.
-
event_uuid
¤str
, default:'outlier_event'
) –A UUID or identifier for detected outlier events.
-
time_threshold
¤str
, default:'5min'
) –The time threshold to group close events together.
Methods:
-
detect_outliers_iqr
–Detects outliers using the IQR method.
-
detect_outliers_zscore
–Detects outliers using the Z-score method.
-
get_dataframe
–Returns the processed DataFrame.
Source code in src/ts_shape/events/quality/outlier_detection.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
detect_outliers_iqr
¤
Detects outliers using the IQR method.
Parameters:
-
threshold
¤tuple
, default:(1.5, 1.5)
) –The multipliers for the IQR range for detecting outliers (lower, upper).
Returns:
-
DataFrame
–pd.DataFrame: A DataFrame of detected outliers and grouped events.
Source code in src/ts_shape/events/quality/outlier_detection.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
detect_outliers_zscore
¤
Detects outliers using the Z-score method.
Parameters:
Returns:
-
DataFrame
–pd.DataFrame: A DataFrame of detected outliers and grouped events.
Source code in src/ts_shape/events/quality/outlier_detection.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|
get_dataframe
¤
get_dataframe() -> DataFrame
Returns the processed DataFrame.
Source code in src/ts_shape/utils/base.py
34 35 36 |
|