Skip to content
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

Linear regression #52

Merged
merged 7 commits into from
Jul 19, 2014
Merged

Conversation

njern
Copy link
Collaborator

@njern 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
Copy link
Collaborator Author

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
@njern njern mentioned this pull request Jul 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants