Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Linear regression #52

merged 7 commits into from Jul 19, 2014


None yet
2 participants

njern commented Jul 19, 2014

An implementation of linear regression, accompanied by unit tests & benchmarks.

Includes some test data (exams.csv / exam.csv) from here

Tested & compared results using the online calculator available here and results seem to match. Meaning, either my implementation is correct or I have re-implemented the same bugs as xuru.org... 😄

It's also reasonably fast. Single-threaded on my machine:

BenchmarkLinearRegressionOneRow  5000000           326 ns/op

njern commented Jul 19, 2014

One thing to note here is that I slightly diverged from previous the Fit() / Predict() interface by returning errors from both. I think this would be a great refactoring in other parts of the library as well... but please let me know what you think.

sjwhitworth added a commit that referenced this pull request Jul 19, 2014

@sjwhitworth sjwhitworth merged commit 222b0ab into sjwhitworth:master Jul 19, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed

@njern njern referenced this pull request Jul 20, 2014


Add benchmark #53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment