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

[SPARK-31944] Add instance weight support in LinearRegressionSummary #28772

Closed
wants to merge 3 commits into from

Conversation

huaxingao
Copy link
Contributor

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

@probot-autolabeler probot-autolabeler bot added the ML label Jun 9, 2020
@SparkQA
Copy link

SparkQA commented Jun 9, 2020

Test build #123706 has finished for PR 28772 at commit 6bd326f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 9, 2020

Test build #123709 has finished for PR 28772 at commit 1d277d6.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@huaxingao
Copy link
Contributor Author

cc @srowen @zhengruifeng

Copy link
Member

@srowen srowen left a 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))
Copy link
Member

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.

Copy link
Contributor Author

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.

@SparkQA
Copy link

SparkQA commented Jun 10, 2020

Test build #123781 has finished for PR 28772 at commit 85382a0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Jun 13, 2020

Merged to master

@srowen srowen closed this in 89c98a4 Jun 13, 2020
@huaxingao
Copy link
Contributor Author

Thanks Sean!

@huaxingao huaxingao deleted the lir_weight_summary branch June 13, 2020 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants