qdrant-client icon indicating copy to clipboard operation
qdrant-client copied to clipboard

distribution_based_score_function failing when n=1

Open swatts-ci opened this issue 11 months ago • 1 comments

Hey @joein - realised this fix wasn't sufficient.

When we get len(response) == 1:

  • We get a div by zero when calculating variance, as we are using Bessel's correction
  • Even without Bessel's correction, we'd get a div by zero later on when scaling the scores

We should instead not use the response when len(response) < 2

Originally posted by @swatts-ci in https://github.com/qdrant/qdrant-client/issues/815#issuecomment-2566468160

swatts-ci avatar Dec 31 '24 13:12 swatts-ci

@swatts-ci resolved by https://github.com/qdrant/qdrant-client/pull/872

jan-kubica avatar Jan 02 '25 20:01 jan-kubica

The fix should've been available as of qdrant-client 1.13.0, closing as completed

joein avatar Apr 23 '25 10:04 joein