-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Address when scores can be very large in osq score test #129592
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
Address when scores can be very large in osq score test #129592
Conversation
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
float diff = scores1[j] - scores2[j]; | ||
assertThat( | ||
"defaultScores: " + scores1[j] + " bulkScores: " + scores2[j], | ||
diff / scores1[j], |
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.
does this not need an Math.abs so as to be Math.abs(diff) / scores1[j]?
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.
you are right!
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
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
Using a static
diff
or epsilon just doesn't work for this test as the scores can be very large, but relatively close.Maybe there is a simpler way, but my mind wasn't wanting to "math" very much.
For example, the seed that this previously failed on had scores like
1.726524E9
and1.7265239E9
, which, given their size, are really close together (within 128). But a static epsilon wouldn't capture that.closes: #128485