Skip to content

Add supports for upper and lower values on boxplot based on the IQR value #63617

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

Merged
merged 11 commits into from
Nov 4, 2020

Conversation

not-napoleon
Copy link
Member

Resolves #60466

This PR expands the functionality of the box plot aggregation to support an upper and lower "whisker" value based on the inter-quartile range. In theory, the upper whisker should be the highest observed value less than or equal to Q3 + (1.5 * IQR), and the lower bound should be the lowest observed value greater than Q1 - (1.5 * IQR). Like all our quantile based aggregations, this will provide an approximation of those values, based on the centroids in the t-digest backing the aggregation.

@not-napoleon not-napoleon added :Analytics/Aggregations Aggregations >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v7.11.0 v8.0.0 labels Oct 13, 2020
@not-napoleon not-napoleon marked this pull request as ready for review October 19, 2020 19:49
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (:Analytics/Aggregations)

@not-napoleon not-napoleon requested a review from imotov October 28, 2020 15:18
 Conflicts:
	x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/boxplot/InternalBoxplotTests.java
Copy link
Contributor

@imotov imotov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -25,8 +27,83 @@
public class InternalBoxplot extends InternalNumericMetricsAggregation.MultiValue implements Boxplot {

enum Metrics {
MIN {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

double q1 = state.quantile(0.25);
double iqr = q3 - q1;
double upper = q3 + (1.5 * iqr);
double lower = q1 - (1.5 * iqr);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be a good idea to make this a constant and give it a short explanation....

@not-napoleon
Copy link
Member Author

@elasticmachine update branch

@not-napoleon not-napoleon merged commit f666ccb into elastic:master Nov 4, 2020
@not-napoleon not-napoleon deleted the boxplot_iqr branch November 4, 2020 19:39
not-napoleon added a commit to not-napoleon/elasticsearch that referenced this pull request Nov 4, 2020
not-napoleon added a commit that referenced this pull request Nov 5, 2020
… IQR value (#63617) (#64611)

* Add supports for upper and lower values on boxplot based on the IQR value (#63617)

* fix List.of usage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v7.11.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add additional box plot agg options
4 participants