apache / apache/otava

API for using Otava as a library

Open
#101 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
177
Forks
35
Avg merge
3d 16h
Merged PRs (30d)
6

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!")

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.