Replies: 1 comment 2 replies
-
Hey @pbhuter, I think you could use the def rms(doc):
return math.sqrt(
math.pow(doc['a'] - a, 2)
+ math.pow(doc['b'] - b, 2)
+ math.pow(doc['c'] - c, 2)
)
print(db.search(A.B.map(rms) < err)) That way you can also test that the Does that work for you? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to evaluate multiple fields in a query and do math with the values in those fields to compare to a given value? For example, this is what I tried (unsuccessfully):
db.search(math.sqrt(math.pow((A.B['a'] - a), 2) + math.pow((A.B['b'] - b), 2) + math.pow((A.B['c'] - c), 2)) < err)
As I said, the above does not work, but I am hoping there is something similar that I can do. Specifically, I am trying to calculate the RMSE of three points and comparing that value to some error threshold.
Beta Was this translation helpful? Give feedback.
All reactions