-
Notifications
You must be signed in to change notification settings - Fork 540
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 support for sample_weights in LinearRegression #4428
Add support for sample_weights in LinearRegression #4428
Conversation
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.
One super small docstring note, otherwise it looks great
This PR has been labeled |
CI Failure on
|
rerun tests |
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.
Changes look great. Just very minor things.
@@ -62,7 +67,8 @@ void olsFit(const raft::handle_t& handle, | |||
bool fit_intercept, | |||
bool normalize, | |||
cudaStream_t stream, | |||
int algo = 0) | |||
int algo = 0, | |||
math_t* sample_weight = nullptr) |
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.
Not something you need to change in this PR, but it would be nice to start adopting std::optional
for arguments like these. Becomes self-documenting as well.
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 agree so I started to make the change but I saw that std::optional
support on Cython is very recent and will be added to version 0.30
. For the moment we're using version 0.29
so the adoption of std::optional
on Python-facing functions should maybe wait a bit more.
Needed for rapidsai/cuml#4428 Authors: - Micka (https://github.com/lowener) Approvers: - Corey J. Nolet (https://github.com/cjnolet) URL: #514
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.
LGTM
@gpucibot merge |
Closes rapidsai#4031. Scikit-learn is rescaling the data ([here](https://github.com/scikit-learn/scikit-learn/blob/0d378913be6d7e485b792ea36e9268be31ed52d0/sklearn/linear_model/_base.py#L313)) to take into account the sample_weight parameter. Authors: - Micka (https://github.com/lowener) Approvers: - Dante Gama Dessavre (https://github.com/dantegd) - Corey J. Nolet (https://github.com/cjnolet) URL: rapidsai#4428
Closes #4031.
Scikit-learn is rescaling the data (here) to take into account the sample_weight parameter.