-
Notifications
You must be signed in to change notification settings - Fork 542
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
New analyzer, RatioOfSums #552
Conversation
@rdsharma26, could you take a look at this PR, please? |
Thanks @akalotkin for the PR. Can you add the copyright header to the new file, in order to unblock the build? |
@rdsharma26 The copyright has been added. |
Thank you. The changes look good and we are internally reviewing as well. We will get back to you by tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution - I am merging your change.
In the future, it would be interesting to implement this for any type of aggregation, not just sum. We could support aggregations like average to make this more generic.
Opened this to track |
* Added RatioOfSums analyzer and tests * Unit test for divide by zero and code cleanup. * More detailed Scaladoc * Fixed docs to include Double.NegativeInfinity * Add copyright to new file
* Added RatioOfSums analyzer and tests * Unit test for divide by zero and code cleanup. * More detailed Scaladoc * Fixed docs to include Double.NegativeInfinity * Add copyright to new file
* Added RatioOfSums analyzer and tests * Unit test for divide by zero and code cleanup. * More detailed Scaladoc * Fixed docs to include Double.NegativeInfinity * Add copyright to new file
* Added RatioOfSums analyzer and tests * Unit test for divide by zero and code cleanup. * More detailed Scaladoc * Fixed docs to include Double.NegativeInfinity * Add copyright to new file
* Added RatioOfSums analyzer and tests * Unit test for divide by zero and code cleanup. * More detailed Scaladoc * Fixed docs to include Double.NegativeInfinity * Add copyright to new file
* Added RatioOfSums analyzer and tests * Unit test for divide by zero and code cleanup. * More detailed Scaladoc * Fixed docs to include Double.NegativeInfinity * Add copyright to new file
* Added RatioOfSums analyzer and tests * Unit test for divide by zero and code cleanup. * More detailed Scaladoc * Fixed docs to include Double.NegativeInfinity * Add copyright to new file
* Added RatioOfSums analyzer and tests * Unit test for divide by zero and code cleanup. * More detailed Scaladoc * Fixed docs to include Double.NegativeInfinity * Add copyright to new file
Issue #, if available:
Description of changes:
This PR creates a new analyzer called RatioOfSums. It aggregates and sums 2 separate columns, then divides them.
For example, imagine a baseball dataset that contains hits and total at-bats, with a row for every player in every game. If a player's batting average (total hits/total at-bats) changes by more than 0.2 in one week, an error or warning could be given. Another example is a % of total calculation in a table that has many rows with facts val1, val2, val3, total, and we want to ensure that val1's percent of the total doesn't change more than X in a given time period.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.