Skip to content
Snippets Groups Projects
Commit 207adb79 authored by Peter Lünenschloß's avatar Peter Lünenschloß
Browse files

added MAD operator to the lib tools

parent b6c5cca0
No related branches found
No related tags found
1 merge request!206MAD operator added to lib.tools
Pipeline #14749 passed with stage
in 6 minutes and 14 seconds
......@@ -13,7 +13,7 @@ import numpy as np
import numba as nb
from sklearn.neighbors import NearestNeighbors
from scipy.stats import iqr
from scipy.stats import iqr, median_abs_deviation
import numpy.polynomial.polynomial as poly
logger = logging.getLogger("SaQC")
......@@ -103,6 +103,12 @@ def standardizeByMean(ts):
def standardizeByMedian(ts):
# standardization with median (MAD)
# NO SCALING
return (ts - np.median(ts)) / median_abs_deviation(ts, nan_policy="omit")
def standardizeByIQR(ts):
# standardization with median and interquartile range
return (ts - np.median(ts)) / iqr(ts, nan_policy="omit")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment