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

Merge branch 'uniLOFFix' into 'develop'

fixing ghost scores phenomenon

See merge request !750
parents 66a5c9f6 33989bbf
No related branches found
No related tags found
1 merge request!750fixing ghost scores phenomenon
Pipeline #188984 passed with stages
in 7 minutes and 45 seconds
......@@ -487,8 +487,13 @@ class ScoresMixin:
OutliersMixin._validateLOF(algorithm, n, p, density)
vals = self._data[field]
if fill_na:
filled = vals.isna()
vals = vals.interpolate("linear")
filled = filled & vals.notna()
else:
filled = pd.Series(False, index=vals.index)
if density == "auto":
density = vals.diff().abs().median()
......@@ -525,5 +530,6 @@ class ScoresMixin:
scores = scores[n:-n]
score_ser = pd.Series(scores, index=na_bool_ser.index[~na_bool_ser.values])
score_ser = score_ser.reindex(na_bool_ser.index)
score_ser[filled] = np.nan
self._data[field] = score_ser
return self
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