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
c026c560
Commit
c026c560
authored
4 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
progress with implementing flagPlateaus
parent
29f042f9
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
#8907
passed with stage
Stage: test
in 6 minutes and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saqc/funcs/proc_functions.py
+9
-3
9 additions, 3 deletions
saqc/funcs/proc_functions.py
with
9 additions
and
3 deletions
saqc/funcs/proc_functions.py
+
9
−
3
View file @
c026c560
...
...
@@ -5,13 +5,14 @@ import pandas as pd
import
numpy
as
np
from
saqc.core.register
import
register
from
saqc.lib.ts_operators
import
interpolateNANs
,
aggregate2Freq
,
shift2Freq
,
expModelFunc
from
saqc.lib.tools
import
toSequence
,
mergeDios
,
dropper
,
mutateIndex
from
saqc.lib.tools
import
toSequence
,
mergeDios
,
dropper
,
mutateIndex
,
detectDeviants
import
dios
import
functools
from
scipy.optimize
import
curve_fit
from
sklearn.linear_model
import
LinearRegression
from
sklearn.utils
import
resample
ORIGINAL_SUFFIX
=
"
_original
"
METHOD2ARGS
=
{
...
...
@@ -970,8 +971,13 @@ def proc_seefoExpDriftCorrecture(data, field, flagger, maint_data_field, cal_mea
@register
(
masking
=
'
all
'
)
def
proc_flagOffsets
(
data
,
field
,
flagger
,
stat
,
regime_cluster
):
pass
def
proc_flagOffsets
(
data
,
field
,
flagger
,
cluster_field
,
norm_spread
,
metric
=
lambda
x
,
y
:
np
.
abs
(
np
.
nanmean
(
x
)
-
np
.
nanmean
(
y
)),
norm_frac
=
0.5
):
clusterser
=
data
[
cluster_field
]
cluster_num
=
clusterser
.
max
()
+
1
cluster_dios
=
dios
.
DictOfSeries
({
i
:
data
[
field
][
clusterser
==
i
]
for
i
in
range
(
cluster_num
)})
plateaus
=
detectDeviants
(
cluster_dios
,
metric
,
norm_spread
,
norm_frac
)
...
...
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