This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients pablogsal, rhettinger, steven.daprano
Date 2021-05-16.19:48:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org>
In-reply-to
Content
The current signature is:

    linear_regression(regressor, dependent_variable)

While the term "regressor" is used in some problem domains, it isn't well known outside of those domains.   The term "independent_variable" would be better because it is common to all domains and because it is the natural counterpart to "dependent_variable".

Another issue is that the return value is a named tuple in the form:

    LinearRegression(intercept, slope)

While that order is seen in multiple linear regression, most people first learn it in algebra as the slope/intercept form:  y = mx + b.   That will be the natural order for a majority of users, especially given that we aren't supporting multiple linear regression.

The named tuple is called LinearRegression which describes how the result was obtained rather than the result itself.  The output of any process that fits data to a line is a line.  The named tuple should be called Line because that is what it describes.  Also, a Line class would be reusuable for other purposes that linear regression.

Proposed signature:

  linear_regression(independent_variable, dependent_variable) -> Line(slope, intercept)
History
Date User Action Args
2021-05-16 19:48:29rhettingersetrecipients: + rhettinger, steven.daprano, pablogsal
2021-05-16 19:48:29rhettingersetmessageid: <1621194509.14.0.657666659025.issue44151@roundup.psfhosted.org>
2021-05-16 19:48:29rhettingerlinkissue44151 messages
2021-05-16 19:48:28rhettingercreate