ESQL: Add MV_PSERIES_WEIGHTED_SUM for score calculations used by security solution#109017
Merged
machadoum merged 28 commits intoelastic:mainfrom Jul 31, 2024
Merged
ESQL: Add MV_PSERIES_WEIGHTED_SUM for score calculations used by security solution#109017machadoum merged 28 commits intoelastic:mainfrom
MV_PSERIES_WEIGHTED_SUM for score calculations used by security solution#109017machadoum merged 28 commits intoelastic:mainfrom
Conversation
nik9000
reviewed
May 24, 2024
...n/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvRiemannZeta.java
Outdated
Show resolved
Hide resolved
MV_PSERIES_WEIGHTED_SUM for score calculations used by security
MV_PSERIES_WEIGHTED_SUM for score calculations used by securityMV_PSERIES_WEIGHTED_SUM for score calculations used by security solution
Collaborator
|
Hi @machadoum, I've created a changelog YAML for you. |
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
nik9000
approved these changes
Jul 26, 2024
...org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvPSeriesWeightedSum.java
Outdated
Show resolved
Hide resolved
nik9000
reviewed
Jul 26, 2024
...org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvPSeriesWeightedSum.java
Show resolved
Hide resolved
nik9000
requested changes
Jul 26, 2024
...org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvPSeriesWeightedSum.java
Outdated
Show resolved
Hide resolved
...org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvPSeriesWeightedSum.java
Outdated
Show resolved
Hide resolved
...org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvPSeriesWeightedSum.java
Outdated
Show resolved
Hide resolved
astefan
reviewed
Jul 26, 2024
...sql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java
Outdated
Show resolved
Hide resolved
...org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvPSeriesWeightedSum.java
Outdated
Show resolved
Hide resolved
...org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvPSeriesWeightedSum.java
Show resolved
Hide resolved
Member
|
I pushed a bit with |
Member
|
Fix for the problem with |
Member
Which I merged in. |
ivancea
reviewed
Jul 26, 2024
...asticsearch/xpack/esql/expression/function/scalar/multivalue/AbstractMultivalueFunction.java
Outdated
Show resolved
Hide resolved
...esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/package-info.java
Outdated
Show resolved
Hide resolved
...lasticsearch/xpack/esql/expression/function/scalar/multivalue/MvPSeriesWeightedSumTests.java
Show resolved
Hide resolved
nik9000
reviewed
Jul 26, 2024
...org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvPSeriesWeightedSum.java
Outdated
Show resolved
Hide resolved
nik9000
approved these changes
Jul 29, 2024
ivancea
approved these changes
Jul 30, 2024
...lasticsearch/xpack/esql/expression/function/scalar/multivalue/MvPSeriesWeightedSumTests.java
Outdated
Show resolved
Hide resolved
Member
|
Thanks for all the iterations!
…On Wed, Jul 31, 2024, 6:08 AM Pablo Machado ***@***.***> wrote:
Merged #109017 <#109017>
into main.
—
Reply to this email directly, view it on GitHub
<#109017 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABUXIXB6MUEG67DLL5N6WLZPCZTFAVCNFSM6AAAAABIHTEC6WVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTG4YDONJWHAYTSNQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
MV_PSERIES_WEIGHTED_SUMwhich security solution will use.This PR created
MV_PSERIES_WEIGHTED_SUMfunction for converting sorted lists of numbers into a bounded score. It is a generalization of the riemann zeta function, but we don't name it because we don't support complex numbers and don't want to make folks think of mystical number theory things. This is just a weighted sum that is adjacent to magic.A bit of math
Given the general form of p-series:
$$\sum_{n=1}^{\infty} \frac{1}{n^p} = \frac{1}{1^p} + \frac{1}{2^p} + \frac{1}{3^p} ...$$
We multiply every element on the input array by its corresponding term in the equation.
MV_PSERIES_WEIGHTED_SUM([70, 45, 21 , 21, 21], 3)Where
3is thepparameter and[70, 45, 21, 21, 21]is the input arrayIt does the following calculation:
$$(\frac{70}{1^3} + \frac{45}{2^3} + \frac{21}{3^3} + \frac{21}{4^3} + \frac{21}{5^3})$$