Skip to content

Fix: Correct comparison direction in EpsilonDiagnosis.find_root_causes#68

Open
yqZhang4480 wants to merge 1 commit intosalesforce:mainfrom
yqZhang4480:fix/epsilon-diagnosis-comparison
Open

Fix: Correct comparison direction in EpsilonDiagnosis.find_root_causes#68
yqZhang4480 wants to merge 1 commit intosalesforce:mainfrom
yqZhang4480:fix/epsilon-diagnosis-comparison

Conversation

@yqZhang4480
Copy link

Summary

The original implementation incorrectly identified metrics with HIGH correlation as root causes. According to epsilon-Diagnosis algorithm, metrics with LOW correlation between normal and abnormal data should be flagged as root causes (indicating behavior change).

Changes

  • Change comparison from > to < for threshold check
  • Change sort order from descending to ascending (lower correlation = more suspicious)
  • Add assertion to test to verify correctness

Impact

This fix improves Recall@1 from 0.02 to 0.09 and Recall@3 from 0.02 to 0.19 on generated datasets (according to my test). The latter are more matching the performance reported in README.

@salesforce-cla
Copy link

salesforce-cla bot commented Feb 3, 2026

Thanks for the contribution! Before we can merge this, we need @yqZhang4480 to sign the Salesforce Inc. Contributor License Agreement.

The original implementation incorrectly identified metrics with HIGH correlation
as root causes. According to epsilon-Diagnosis algorithm, metrics with LOW
correlation between normal and abnormal data should be flagged as root causes
(indicating behavior change).

Changes:
- Change comparison from `>` to `<` for threshold check
- Change sort order from descending to ascending (lower correlation = more suspicious)
- Add assertion to test to verify correctness

This fix improves Recall@1 from 0.02 to 0.09 and Recall@3 from 0.02 to 0.19
on generated datasets, matching the performance reported in README.
@yqZhang4480 yqZhang4480 force-pushed the fix/epsilon-diagnosis-comparison branch from 7670f9c to 8e177e8 Compare February 3, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant