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

added option to set changepoints flags n cpd cluster func

parent 1a418f09
No related branches found
No related tags found
3 merge requests!193Release 1.4,!188Release 1.4,!138WIP: Detect and reset offset
...@@ -432,7 +432,7 @@ def _reduceCPCluster(stat_arr, thresh_arr, start, end, obj_func, num_val): ...@@ -432,7 +432,7 @@ def _reduceCPCluster(stat_arr, thresh_arr, start, end, obj_func, num_val):
@register(masking='field') @register(masking='field')
def modelling_clusterByChangePoints(data, field, flagger, stat_func, thresh_func, bwd_window, min_periods_bwd, def modelling_clusterByChangePoints(data, field, flagger, stat_func, thresh_func, bwd_window, min_periods_bwd,
fwd_window=None, min_periods_fwd=None, closed='both', try_to_jit=True, fwd_window=None, min_periods_fwd=None, closed='both', try_to_jit=True,
reduce_window=None, reduce_func=lambda x, y: x.argmax(), **kwargs): reduce_window=None, reduce_func=lambda x, y: x.argmax(), flag_changepoints=False, **kwargs):
""" """
Assigns label to the data, aiming to reflect continous regimes of the processes the data is assumed to be Assigns label to the data, aiming to reflect continous regimes of the processes the data is assumed to be
generated by. generated by.
...@@ -536,4 +536,6 @@ def modelling_clusterByChangePoints(data, field, flagger, stat_func, thresh_func ...@@ -536,4 +536,6 @@ def modelling_clusterByChangePoints(data, field, flagger, stat_func, thresh_func
cluster = cluster.cumsum() cluster = cluster.cumsum()
data[field] = cluster data[field] = cluster
flagger = flagger.setFlags(field, flag=flagger.UNFLAGGED, force=True, **kwargs) flagger = flagger.setFlags(field, flag=flagger.UNFLAGGED, force=True, **kwargs)
if flag_changepoints:
flagger.setFlags(field, loc=det_index)
return data, flagger return data, flagger
\ No newline at end of file
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