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

Merge branch 'deprecateFlagMVScores' into 'develop'

Deprecate flag mv scores

See merge request !845
parents 6aacbd75 89e28f63
No related branches found
No related tags found
1 merge request!845Deprecate flag mv scores
Pipeline #206458 passed with stages
in 7 minutes and 23 seconds
......@@ -32,6 +32,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
- `flagManual` in favor of `setFlags`
- `flagRaise` with delegation to better replacements `flagZScore`, `flagUniLOF`, `flagJumps` or `flagOffset`
- `flagByGrubbs` with delegation to better replacements `flagZScore`, `flagUniLOF`s
- `flagMVScore` with delegation to manual application of the steps
## [2.5.0](https://git.ufz.de/rdm-software/saqc/-/tags/v2.4.1) - 2023-06-22
[List of commits](https://git.ufz.de/rdm-software/saqc/-/compare/v2.4.1...v2.5.0)
### Added
......
......@@ -12,7 +12,7 @@ Multivariate outlier detection.
.. autosummary::
:nosignatures:
~SaQC.flagMVScores
~SaQC.flagCrossStatistics
~SaQC.flagLOF
~SaQC.flagZScore
......@@ -723,6 +723,17 @@ class OutliersMixin:
DeprecationWarning,
)
warnings.warn(
"""
FlagMVScores is deprecated and will be removed with Version 2.8.
To replicate the function, transform the different fields involved
via explicit applications of some transformations, than calculate the
kNN scores via `saqc.SaQC.assignkNScores` and finally assign the STRAY
algorithm via `saqc.SaQC.flagByStray`.
""",
DeprecationWarning,
)
# Hint: checking is delegated to the called functions
fields = toSequence(field)
......
......@@ -93,13 +93,17 @@ def test_flagMVScores(course_3):
s2 = pd.Series(data=s2.values, index=s1.index)
data = DictOfSeries(field1=s1, field2=s2)
flags = initFlagsLike(data)
qc = SaQC(data, flags).flagMVScores(
field=fields,
trafo=np.log,
iter_start=0.95,
n=10,
flag=BAD,
qc = SaQC(data, flags)
qc = qc.processGeneric("field1", func=lambda x: np.log(x))
qc = qc.processGeneric("field2", func=lambda x: np.log(x))
qc = qc.assignKNNScore(
["field1", "field2"],
target="kNNScores",
)
qc = qc.flagByStray("kNNScores", iter_start=0.95)
qc = qc.transferFlags("kNNScores", target="field1")
qc = qc.transferFlags("kNNScores", target="field2")
_check(fields, qc.flags, characteristics)
......
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