Skip to content

Commit

Permalink
fix: capa pruning condition <= rather than <
Browse files Browse the repository at this point in the history
The <= condition passes all tests, while < don't
  • Loading branch information
Tveten committed Jan 3, 2025
1 parent 2a9ec6f commit c601034
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion skchange/anomaly_detectors/capa.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def run_capa(

# Pruning the admissible starts
penalty_sum = segment_penalised_saving.penalty.values[-1]
saving_too_low = candidate_savings + penalty_sum < opt_savings[t + 1]
saving_too_low = candidate_savings + penalty_sum <= opt_savings[t + 1]
too_long_segment = starts < t - max_segment_length + 2
prune = saving_too_low | too_long_segment
starts = starts[~prune]
Expand Down

0 comments on commit c601034

Please sign in to comment.