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

Question: Does the linear regression class consider weights? #9

Closed
Aliciawyse opened this issue Oct 31, 2019 · 6 comments
Closed

Question: Does the linear regression class consider weights? #9

Aliciawyse opened this issue Oct 31, 2019 · 6 comments

Comments

@Aliciawyse
Copy link

Hey there!

This is an awesome library -- thank you!

Quick question... In python, I can call .fit on a linear regression and pass it a sample_weight (as seen here https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html#sklearn.linear_model.LinearRegression.fit).

I've been reading your code here https://github.com/ankane/eps/blob/master/lib/eps/linear_regression.rb and I don't see if there's a way to incorporate weights. Is this possible?

@ankane
Copy link
Owner

ankane commented Oct 31, 2019

Hey @Aliciawyse, weights aren't currently supported right now, but happy to review a PR.

@Aliciawyse
Copy link
Author

Hey there @ankane thanks for the feedback!

Another quick question... Can your code do multivariable linear regression?

@Aliciawyse
Copy link
Author

Ah, I see that it does here.

def test_multiple_regression
👍

ankane added a commit that referenced this issue Nov 12, 2019
@ankane
Copy link
Owner

ankane commented Nov 12, 2019

Just added weights to LightGBM, so it should be a bit easier to add it to the other algorithms.

@ankane
Copy link
Owner

ankane commented Nov 13, 2019

Sorry for the noise. Weighted OLS is now on master 🎉

Eps::Model.new(data, weight: [1, 2, 3])  # pass an array
Eps::Model.new(data, weight: :weight)    # or a key in data

@Aliciawyse
Copy link
Author

Oh snaps! This is great! Thanks @ankane 💯 Giving this a try today!

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

No branches or pull requests

2 participants