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

fix(anomaly-detection): Handle illegal padding amount #1136

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/seer/anomaly_detection/detectors/mp_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def get_mp_dist_from_mp(
mp_dist = normalizer.normalize(mp_dist)

if pad_to_len is not None:
if pad_to_len < len(mp_dist):
raise Exception(
"Requested length should be greater than or equal to current mp_dist"
)
nan_value_count = np.empty(pad_to_len - len(mp_dist))
nan_value_count.fill(np.nan)
mp_dist_updated = np.concatenate((nan_value_count, mp_dist))
Expand Down
Loading