-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
I recently utilized Otava by calling the functions directly instead of using an importer. This is useful if you have data received by Python in some custom way and want to programmically utilize Otava on the data. There isn't a lot of documentation on this so it was sort of like looking at unit tests and guessing at it. I figured it out, but I am not sure if I am doing it entirely correctly. It would be useful if this was documented officially as an option, unless for some reason you rather people be limited to using an existing importer?
Here is my potentially bad attempt at an example of this
from otava.analysis import compute_change_points, ChangePoint
def _compute_change_points(p, m=0.0, w=30, series=[], new_data=None):
return compute_change_points(series, window_len=w, max_pvalue=p, min_magnitude=m, new_data=new_data)
#Bring in your data from another source, and set y_list to the data...
y_list = []
#Tweak the parameters to appropriate max_pvalue and min_magnitude options, as these may differ depending on dataset and sensitivity desired
math_results,old_math_results = _compute_change_points(0.005, m=0.003, w=100, series=y_list, new_data=None)
index_list = []
c: ChangePoint
for c in math_results:
index_list.append(c.index)
for index, y in enumerate(y_list):
if index in index_list:
print("This Y should be marked!")
Metadata
Metadata
Assignees
Labels
No labels