-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Add additional linear regression functions #21630
Conversation
Two things I wanted to mention:
|
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.
It might be worthwhile to add a couple light utilities to reduce the duplication among the aggregation tests. Otherwise code LGTM>
testNonTrivialAggregation(new Double[] {1.0, 4.0, 9.0, 16.0, 25.0}, new Double[] {1.0, 2.0, 3.0, 4.0, 5.0}); | ||
} | ||
|
||
private void testNonTrivialAggregation(Double[] y, Double[] x) |
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.
These methods all look nearly identical, can you create a utility method to consolidate?
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, updated. Some methods have been put into the abstract class.
Codenotify: Notifying subscribers in CODENOTIFY files for diff e01dc52...bf2d675.
|
@steveburnett Thanks.
|
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.
@@ -590,6 +590,34 @@ Statistical Aggregate Functions | |||
Returns linear regression slope of input values. ``y`` is the dependent | |||
value. ``x`` is the independent value. | |||
|
|||
.. function:: regr_avgx(y, x) -> double |
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.
.. function:: regr_avgx(y, x) -> double | |
.. function:: regr_avgx(y, x) -> double | |
Returns the average of the independent value in a group. ``y`` is the dependent | ||
value. ``x`` is the independent value. | ||
|
||
.. function:: regr_avgy(y, x) -> double |
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.
.. function:: regr_avgy(y, x) -> double | |
.. function:: regr_avgy(y, x) -> double | |
Returns the average of the dependent value in a group. ``y`` is the dependent | ||
value. ``x`` is the independent value. | ||
|
||
.. function:: regr_count(y, x) -> double |
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.
.. function:: regr_count(y, x) -> double | |
.. function:: regr_count(y, x) -> double | |
Returns the number of non-null pairs of input values. ``y`` is the dependent | ||
value. ``x`` is the independent value. | ||
|
||
.. function:: regr_r2(y, x) -> double |
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.
.. function:: regr_r2(y, x) -> double | |
.. function:: regr_r2(y, x) -> double | |
Returns the coefficient of determination of the linear regression. ``y`` is the dependent | ||
value. ``x`` is the independent value. | ||
|
||
.. function:: regr_sxy(y, x) -> double |
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.
.. function:: regr_sxy(y, x) -> double | |
.. function:: regr_sxy(y, x) -> double | |
Returns the sum of the product of the dependent and independent values in a group. ``y`` is the dependent | ||
value. ``x`` is the independent value. | ||
|
||
.. function:: regr_syy(y, x) -> double |
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.
.. function:: regr_syy(y, x) -> double | |
.. function:: regr_syy(y, x) -> double | |
Returns the sum of the squares of the dependent values in a group. ``y`` is the dependent | ||
value. ``x`` is the independent value. | ||
|
||
.. function:: regr_sxx(y, x) -> double |
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.
.. function:: regr_sxx(y, x) -> double | |
.. function:: regr_sxx(y, x) -> double | |
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.
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, Updated. Here's the new screenshot of what the doc build looks like:
Thanks! I just now did a new pull and local build of the doc and everything looks good! Updating my review to Approve for the docs.
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.
LGTM! (docs)
New pull of branch and new local build of docs, everything looks good. Thanks!
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.
LGTM. Please squash commits and I can help merge. Thank you!
7049eff
to
e87bb19
Compare
@tdcmeehan Thanks, done. |
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.
Changes look good, but please make sure the commit follows our guidelines.. Consider Add additional linear regression functions
as a title and list out the functions in the body.
@tdcmeehan Updated the title and description. |
Thanks @8dukongjian, but I meant the commit message--the message in Git history. The link above describes this. |
Add REGR_AVGX, REGR_AVGY, REGR_COUNT, REGR_R2, REGR_SXX, REGR_SXY, and REGR_SYY.
e87bb19
to
bf2d675
Compare
@tdcmeehan Thanks, done. |
Description
Fix #21328
Add additional linear regression functions, include:
Release Notes
Please follow release notes guidelines and fill in the release notes below.