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
a1b20967
Commit
a1b20967
authored
4 years ago
by
Bert Palm
🎇
Browse files
Options
Downloads
Patches
Plain Diff
fixed residues.py and scores.py
parent
e5f85cc6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!231
new Flagger and Stuff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
saqc/funcs/residues.py
+20
-7
20 additions, 7 deletions
saqc/funcs/residues.py
saqc/funcs/scores.py
+7
-6
7 additions, 6 deletions
saqc/funcs/scores.py
with
27 additions
and
13 deletions
saqc/funcs/residues.py
+
20
−
7
View file @
a1b20967
...
...
@@ -99,10 +99,16 @@ def calculatePolynomialResidues(
Flags values may have changed relatively to the flagger input.
"""
data
,
flagger
=
fitPolynomial
(
data
,
field
,
flagger
,
winsz
,
polydeg
,
numba
=
numba
,
eval_flags
=
eval_flags
,
min_periods
=
min_periods
,
return_residues
=
True
,
**
kwargs
)
return
data
,
flagger
return
fitPolynomial
(
data
,
field
,
flagger
,
winsz
=
winsz
,
polydeg
=
polydeg
,
numba
=
numba
,
eval_flags
=
eval_flags
,
min_periods
=
min_periods
,
return_residues
=
True
,
**
kwargs
)
@register
(
masking
=
'
field
'
,
module
=
"
residues
"
)
...
...
@@ -118,7 +124,14 @@ def calculateRollingResidues(
**
kwargs
)
->
Tuple
[
DictOfSeries
,
Flagger
]:
data
,
flagger
=
roll
(
data
,
field
,
flagger
,
winsz
,
func
=
func
,
eval_flags
=
eval_flags
,
min_periods
=
min_periods
,
center
=
center
,
return_residues
=
True
,
**
kwargs
)
return
roll
(
data
,
field
,
flagger
,
winsz
=
winsz
,
func
=
func
,
eval_flags
=
eval_flags
,
min_periods
=
min_periods
,
center
=
center
,
return_residues
=
True
,
**
kwargs
)
return
data
,
flagger
This diff is collapsed.
Click to expand it.
saqc/funcs/scores.py
+
7
−
6
View file @
a1b20967
...
...
@@ -108,17 +108,18 @@ def assignKNNScore(
References
----------
[1] https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.NearestNeighbors.html
"""
data
=
data
.
copy
()
fields
=
toSequence
(
fields
)
val_frame
=
data
[
fields
]
score_index
=
val_frame
.
index_of
(
"
shared
"
)
score_ser
=
pd
.
Series
(
np
.
nan
,
index
=
score_index
,
name
=
target_field
)
val_frame
=
val_frame
.
loc
[
val_frame
.
index_of
(
"
shared
"
)].
to_df
()
val_frame
.
dropna
(
inplace
=
True
)
if
not
trafo_on_partition
:
val_frame
=
val_frame
.
transform
(
trafo
)
...
...
@@ -154,11 +155,11 @@ def assignKNNScore(
score_ser
[
partition
.
index
]
=
resids
score_flagger
=
flagger
.
initFlags
(
score_ser
)
# this unconditionally overwrite a column,
# may we should fire a warning ? -- palmb
if
target_field
in
flagger
.
columns
:
flagger
=
flagger
.
slice
(
drop
=
target_field
)
flagger
.
drop
(
target_field
)
flagger
[
target_field
]
=
score_ser
flagger
=
flagger
.
merge
(
score_flagger
)
data
[
target_field
]
=
score_ser
return
data
,
flagger
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