Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pot): create functions that utilises Peaks Over Threshold method #6

Merged
merged 13 commits into from
Dec 4, 2023

Conversation

Aeternalis-Ingenium
Copy link
Owner

@Aeternalis-Ingenium Aeternalis-Ingenium commented Dec 4, 2023

  • Create get_threshold_peaks_over_threshold() function to calculate the dynamic threshold using pd.expand.quantile() function.
    -[X] Create get_exceedance_peaks_over_threshold() function to extract exceedances.
  • Create read_ts() that executes create_ts-from_csv() and create_ts-from_xcls() which are wrapper functions from pd.read_csv() and pd.read_excel().
  • Write test for all functions.
  • Import all functions into the __init__.py of the respective directory.

closes #3
closes #5

For lazy users that want to get directly the correct form of Series 😜
…dynamic threshold for exceedance extraction in POT method
…ovides the correct result

The function get_exceedance_peaks_over_threshold executes the function get_threshold_peaks_over_threshold to get pot thresholds before subtracting the values with the respective threshold. Now, the low anomaly_type is a bit tricky, but it is solved! The trick is to consider exceedances as always a positive value because it is the difference between data value and threshold value.
…es the correct pd.Series

read_ts is an overload and wrapper function for pd.read_csv and pd.read_excel.
Copy link

codecov bot commented Dec 4, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9a7a06c) 100.00% compared to head (881faa1) 100.00%.
Report is 1 commits behind head on trunk.

Additional details and impacted files
@@            Coverage Diff            @@
##             trunk        #6   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         8    +7     
  Lines            1        33   +32     
=========================================
+ Hits             1        33   +32     
Flag Coverage Δ
anomalytics 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Aeternalis-Ingenium Aeternalis-Ingenium merged commit 2ae8c00 into trunk Dec 4, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Wrapper Function for Reading File to Pandas Series Implement Peaks Over Threshold Method
2 participants