Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
36
Issue boards
Milestones
Wiki
Code
Merge requests
8
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rdm-software
SaQC
Commits
49d0c93c
Commit
49d0c93c
authored
4 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
...
parent
519572e8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!193
Release 1.4
,
!188
Release 1.4
,
!138
WIP: Detect and reset offset
Pipeline
#8747
passed with stage
Stage: test
in 6 minutes and 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saqc/funcs/functions.py
+15
-8
15 additions, 8 deletions
saqc/funcs/functions.py
with
15 additions
and
8 deletions
saqc/funcs/functions.py
+
15
−
8
View file @
49d0c93c
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment