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

...

parent 519572e8
No related branches found
No related tags found
3 merge requests!193Release 1.4,!188Release 1.4,!138WIP: Detect and reset offset
Pipeline #8747 passed with stage
in 6 minutes and 12 seconds
......@@ -1048,7 +1048,8 @@ def flagDriftFromReference(data, field, flagger, fields, segment_freq, thresh,
return data, flagger
@numba.jit(nopython=True, parallel=True)
#@numba.jit(parallel=True)
def _slidingWindowSearch(data_arr, bwd_start, fwd_end, stat_func, thresh_func, num_val):
stat_arr = np.zeros(num_val)
thresh_arr = np.zeros(num_val)
......@@ -1079,11 +1080,7 @@ def flagChangePoints(data, field, flagger, stat_func, thresh_func, bwd_window, m
"""
Function for change point detection based on sliding window search.
The function provides general basic architecture for applying two-sided t-tests,
max-likelyhood modelling or piecewise regression modelling in order to detect changepoints
via a sliding "twin window" search.
See examples in the examples section to get an idea of the interface and functionality.
The function provides basic architecture for basic sliding window changepoint detection.
Parameters
----------
......@@ -1093,12 +1090,22 @@ def flagChangePoints(data, field, flagger, stat_func, thresh_func, bwd_window, m
The reference variable, the deviation from wich determines the flagging.
flagger : saqc.flagger
A flagger object, holding flags and additional informations related to `data`.
stat_func : {Callable[numpy.array], Callable[numpy.array, numpy.array]}
stat_func : Callable[numpy.array, numpy.array]
A function that assigns a value to every twin window. Left window content will be passed to first variable,
right window content will be passed to the second.
thresh_func : {float, Callable[numpy.array, numpy.array]}
A function that determines the value level, exceeding wich qualifies a timestamps stat func value as denoting a
changepoint.
bwd_window : str
The left (backwards facing) windows temporal extension (freq-string).
min_periods_bwd : {str, int}
Minimum number of periods that have to be present in a backwards facing window, for a changepoint test to be
performed.
fwd_window : {None, str}, default None
The right (forward facing) windows temporal extension (freq-string).
min_periods_fwd : {None, str, int}, default None
Minimum number of periods that have to be present in a forward facing window, for a changepoint test to be
performed.
closed : {'right', 'left', 'both', 'neither'}, default 'both'
Returns
......@@ -1106,7 +1113,7 @@ def flagChangePoints(data, field, flagger, stat_func, thresh_func, bwd_window, m
"""
data_ser = data[field]
data_ser = data[field].dropna()
center = False
var_len = data_ser.shape[0]
if fwd_window is None:
......
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