-
Notifications
You must be signed in to change notification settings - Fork 163
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(CostNormal): add small bias in covariance matrix #198
Conversation
to cope with signals with truly constant segments
for more information, see https://pre-commit.ci
I still need to add tests for the case |
If the user asks n_bkps change-points, it will return n_bkps change-points, even on constant signals (before it returned none).
…s/ruptures into fix/costnormal-jitter
for more information, see https://pre-commit.ci
Codecov Report
@@ Coverage Diff @@
## master #198 +/- ##
==========================================
+ Coverage 96.59% 96.70% +0.11%
==========================================
Files 40 40
Lines 969 972 +3
==========================================
+ Hits 936 940 +4
+ Misses 33 32 -1
Continue to review full report at Codecov.
|
…s/ruptures into fix/costnormal-jitter
for more information, see https://pre-commit.ci
In This will be the default behaviour starting version 1.1.5. To prevent this new behaviour (i.e. set epsilon to 0), the user can simply do the following (change c = rpt.costs.CostNormal(add_small_diag=False)
algo = rpt.Dynp(custom_cost=c)
# or, equivalently,
algo = rpt.Dynp(model="normal", params={"add_small_diag": False}) The change has been added to the documentation. Also, I have slightly modified the behaviour of |
I agree that users should be informed/notified in case of a change in the behaviour. Here, the warning is emitted in all cases. I am just wondering if we cannot limit the cases when the warning should be emit.
|
Yes. I will remove the warning if the old behaviour is used. As for your second point, I also think that the new behaviour should be the default one. Being able to correctly detect truly constant segments is a normal thing to expect by default. Normally it should not change anything but we never know, hence the warning. |
for the case `add_small_diag=False`
Co-authored-by: Olivier Boulant <olivier.boulant@hey.com>
This reverts commit 3dca2f4.
This reverts commit 74ca7e9.
If the user wants the old behaviour of costnormal (ie `add_small_diag=False`), the result will be the same as before
…s/ruptures into fix/costnormal-jitter
for more information, see https://pre-commit.ci
I reverted some previous commits (in cedc408). So now, if a user specifies |
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.
LGTM !
On signals with truly constant segments, the CostNormal detection fails because the covariance matrix is badly conditioned, resulting in infinite value for the cost function. See #196.