ddbourgin / numpy-ml

Machine learning, in numpy
https://numpy-ml.readthedocs.io/
GNU General Public License v3.0
15.26k stars 3.7k forks source link

Feature request: Accept multiple samples for online least squares #73

Closed ddbourgin closed 3 years ago

ddbourgin commented 3 years ago

The current update method for the LinearRegression estimator relies on the Sherman-Morrison formula to update the (inverse) covariance matrix for a single new example. This is computationally provident, but limits the use of the method to single-example updates.

It would be great to also accept multiple examples (e.g., arrays of dimension NxM rather than just 1xM) using the Woodbury matrix identity. This will be computationally more expensive as it will require a matrix inversion, but potentially more valuable for certain use-cases.

ddbourgin commented 3 years ago

Closed via #74