-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
ENH: Change behavior for numpy.polynomial.polynomial.Polynomial.fit
coefficients
#26401
Comments
I would say that the expansion on the polynomial basis is accurate over the However, I agree that An improvement may be to hide the coefficients into a |
The semantics of |
A |
Currently polynomial fits work as follows
which prints
The result for the raw
fit.coef
is unexpected. The fit is scaled with respect to its current domain, which is by default the endpoints ofx
. Thefit.convert().coef
gives the expected result, but this extra call is somewhat awkward and can easily be overlooked.Proposed new feature or change:
I would prefer to set
domain=[-1, 1]
as a default argument ofnumpy.polynomial.polynomial.Polynomial.fit
, just as it is for thenumpy.polynomial.polynomial.Polynomial
class. This creates commonality, but also avoids the unexpected outcome as in the above example.The text was updated successfully, but these errors were encountered: