Skip to content

Fix max distant value in stake weighted calc#779

Merged
guilherme-brandao merged 4 commits intodevfrom
fix-max-distant-value
Mar 27, 2025
Merged

Fix max distant value in stake weighted calc#779
guilherme-brandao merged 4 commits intodevfrom
fix-max-distant-value

Conversation

@guilherme-brandao
Copy link
Contributor

Purpose of Changes and their Description

This PR improves the implementation of GetStakeWeightedLossMatrix to correctly identify the most distant value from the consensus using absolute differences. The function is used to calculate stake-weighted loss matrices and identify outliers in reported losses.

  • Modified the logic in GetStakeWeightedLossMatrix to properly calculate absolute differences by taking the absolute value of the distance between each value and the consensus
  • Updated tests to verify the correct behavior with values both above and below consensus

Link(s) to Ticket(s) or Issue(s) resolved by this PR

https://linear.app/alloralabs/issue/ENGN-3540/182-incorrect-maxdistant-value-causes-reputers-who-havent-submitted

Copy link
Contributor

@xmariachi xmariachi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a suggestion, otherwise lgtm.

@guilherme-brandao guilherme-brandao marked this pull request as ready for review March 24, 2025 08:42
@guilherme-brandao guilherme-brandao merged commit cc23260 into dev Mar 27, 2025
9 checks passed
@guilherme-brandao guilherme-brandao deleted the fix-max-distant-value branch March 27, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants