Skip to content

Replace lstsq with lstsq_solve #235

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

Closed
wants to merge 1 commit into from
Closed

Replace lstsq with lstsq_solve #235

wants to merge 1 commit into from

Conversation

kgryte
Copy link
Contributor

@kgryte kgryte commented Jul 26, 2021

This PR

  • resolves gh-227 by removing linalg.lstsq and replacing with linalg.lstsq_solve.
  • in contrast to linalg.lstsq, linalg.lstsq_solve only returns the least-squares solution. For singular values, rank, and residuals, users would be required to use other APIs already present in the specification (e.g., linalg.svdvals, linalg.matrix_rank, etc). This is consistent with linear algebra design principles in which functionality should be orthogonal and not duplicated across APIs.

Notes

  • the name lstsq_solve was suggested by @lezcano as an alternative name for lstsq only returning the solutions which does not conflict with existing API names in NumPy and SciPy (e.g., least_squares, lsqr, etc).

@kgryte kgryte added API change Changes to existing functions or objects in the API. topic: Linear Algebra Linear algebra. labels Jul 26, 2021
@kgryte
Copy link
Contributor Author

kgryte commented Aug 16, 2021

As discussed during the weekly consortium meetings (2021-07-29), we decided to remove lstsq altogether given its relatively low usage and difficulty in standardizing (e.g., consider number of variants in SciPy and elsewhere). Should similar functionality be desired in the future, can be addressed in a future revision of the Array API Specification.

Closing...

@kgryte kgryte closed this Aug 16, 2021
@kgryte kgryte mentioned this pull request Aug 16, 2021
@honno honno deleted the replace-lstsq branch February 28, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change Changes to existing functions or objects in the API. topic: Linear Algebra Linear algebra.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return just the solution in linalg.lstsq
1 participant