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

added consecutive numbering of abnormal clusters to flag_regimeAnomaly

parent 1751c8de
No related branches found
No related tags found
3 merge requests!193Release 1.4,!188Release 1.4,!138WIP: Detect and reset offset
......@@ -50,8 +50,8 @@ def breaks_flagRegimeAnomaly(data, field, flagger, cluster_field, norm_spread, l
Has to be in [0,1]. Determines the minimum percentage of samples,
the "normal" group has to comprise to be the normal group actually.
reset_cluster : bool, default False
If True, all data, considered "normal", gets assigned hte cluster Label "0", the
anormal data gets assigned "1" respectively.
If True, all data, considered "normal", gets assigned thee cluster Label "0", the remaining
cluster get numbered consecutively.
kwargs
......@@ -76,8 +76,10 @@ def breaks_flagRegimeAnomaly(data, field, flagger, cluster_field, norm_spread, l
if reset_cluster:
new_cluster = pd.Series(0, index=clusterser.index, dtype=int)
k = 1
for p in plateaus:
new_cluster[cluster_dios.iloc[:, p].index] = 1
new_cluster[cluster_dios.iloc[:, p].index] = k
k += 1
data[cluster_field] = new_cluster
return data, flagger
......
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