[issue44151] Improve parameter names and return value ordering for linear_regression

Steven D'Aprano report at bugs.python.org
Sun May 16 19:53:01 EDT 2021


Steven D'Aprano <steve+python at pearwood.info> added the comment:

> 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.

I think that most people would expect that a Line class would represent a straight line widget in a GUI, not the coefficients of a linear equation.

The result tuple represents an equation (or at least the coefficients of such), not the line itself. If it doesn't have a .draw() method, I don't think we should call it "Line".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44151>
_______________________________________


More information about the Python-bugs-list mailing list