-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
[SPARK-31944] Add instance weight support in LinearRegressionSummary #28772
Conversation
Test build #123706 has finished for PR 28772 at commit
|
Test build #123709 has finished for PR 28772 at commit
|
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.
Looks OK otherwise.
if (!privateModel.isDefined(privateModel.weightCol) || privateModel.getWeightCol.isEmpty) { | ||
lit(1.0) | ||
} else { | ||
checkNonNegativeWeight(col(privateModel.getWeightCol).cast(DoubleType)) |
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.
Is this check needed -- would the regression implementation have already checked it? OK if not.
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.
You are right. This has already been checked. I will remove.
Test build #123781 has finished for PR 28772 at commit
|
Merged to master |
Thanks Sean! |
What changes were proposed in this pull request?
Add instance weight support in LinearRegressionSummary
Why are the changes needed?
LinearRegression and RegressionMetrics support instance weight. We should support instance weight in LinearRegressionSummary too.
Does this PR introduce any user-facing change?
No
How was this patch tested?
add new test