-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
Add linfa-linear package with ordinary least squares regression #20
Conversation
Ensure the linear regression works with f32, f64, c32 and c64 element types, not only with f64.
Use methods from the `approx` instead of our own hand-rolled functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey, added two nitpicks, if you think this is ready we can merge it. I'm a bit ambigious about the error handling, but at the moment we are mostly collecting algorithms so a simple text approach is fine :D The gzip
training data is really cool though
FitInterceptAndNormalize, | ||
} | ||
|
||
fn fit_intercept(options: Options) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you implement this as a member of Options
?
} | ||
|
||
/// Configure the linear regression model to fit an intercept. | ||
pub fn fit_intercept(mut self) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like the name, because fit_intercept
sounds like a special function of fit
, but is actually part of the builder. Perhaps it would be easier to have a pub fn options(&mut self, options: Options)
or alternatively with_intercept
.
I will merge this PR now. If you have something to amend, please do so (otherwise any PR for Ridge/LASSO regression is welcome too 😄 ) |
This PR adds the linfa-linear crate with an ordinary least squares regression model.
It is in spirit similar to PR 10 which looks like it has stalled. It also addresses the issues discussed in this PR and ads example code and tests.