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
fix quantile detector when low/high threshold are the same #1553
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov ReportBase: 94.09% // Head: 94.02% // Decreases project coverage by
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## master #1553 +/- ##
==========================================
- Coverage 94.09% 94.02% -0.07%
==========================================
Files 125 125
Lines 11071 11081 +10
==========================================
+ Hits 10417 10419 +2
- Misses 654 662 +8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks 🚀
) * fix quantile detector when low/high threshold are the same * add test * Update darts/ad/detectors/threshold_detector.py Co-authored-by: Dennis Bader <dennis.bader@gmx.ch> * change syntax * pre commit * pre commit --------- Co-authored-by: Dennis Bader <dennis.bader@gmx.ch> Co-authored-by: madtoinou <32447896+madtoinou@users.noreply.github.com> Co-authored-by: Julien Herzen <julien@unit8.co>
Fixes #1551. Fix the issue raised by philippspengler:
Describe the bug
The QuantileDetector class raises an error during fitting when the time series has low variation.
To Reproduce
series = TimeSeries.from_series(pd.Series([96.0, 96.0, 96.0, 96.0, 96.0, 96.0, 96.0, 96.0, 96.0, 96.0, 96.0, 96.0, 96.0, 96.0, 96.0, 96.0, 96.0, 96.0, 96.0, 96.0, 93.0]))
quantile_detector = QuantileDetector(low_quantile=0.05, high_quantile=0.95)
quantile_detector.fit(series)
Expected behavior
Expect the quantile detector to fit without an error.
System (please complete the following information):
Python version: 3.8.5
darts version 0.23.1
Solution:
The problemed occurred when the low and high quantiles corresponded to the same number, and when calling the threshold detector, an error was raised as it expected two different values. The condition was removed.