opendistro-for-elasticsearch / k-NN

🆕 A machine learning plugin which supports an approximate k-NN search algorithm for Open Distro.
https://opendistro.github.io/
Apache License 2.0
277 stars 55 forks source link

[Question] Is it possible to calculate weighted sum of two different knn score? #362

Open pyk0023 opened 2 years ago

pyk0023 commented 2 years ago

Hello. I have a question about custom scoring.

I can get L2Norm-based knn score and cosine-based knn score.

What I want is weighted sum of two scoring method. score(d,q) = w1 * (1/(1+L2Norm(v1(d),v1(q))) + w2 * cosine(v2(d),v2(q))

Is there any way to get this custom score?

(It seems that only one scoring method is possible for one index, because scoring method is declared in index creating time, am I right?)

jmazanec15 commented 2 years ago

Hi @pyk0023 , I would recommend trying out the painless scoring feature.