You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/03/29 03:34:36 UTC
[GitHub] [spark] zhengruifeng opened a new pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
zhengruifeng opened a new pull request #31985:
URL: https://github.com/apache/spark/pull/31985
### What changes were proposed in this pull request?
1, use new `MultinomialLogisticBlockAggregator` which support virtual centering
2, remove no-used `BlockLogisticAggregator`
### Why are the changes needed?
1, for better convergence;
2, its solution is much close to GLMNET;
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
updated and new test suites
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809042739
**[Test build #136625 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136625/testReport)** for PR 31985 at commit [`cdaafc2`](https://github.com/apache/spark/commit/cdaafc28f458d45a6f1a257b2cea381db7a09637).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] zhengruifeng commented on a change in pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
zhengruifeng commented on a change in pull request #31985:
URL: https://github.com/apache/spark/pull/31985#discussion_r602997003
##########
File path: mllib/src/test/scala/org/apache/spark/ml/classification/LogisticRegressionSuite.scala
##########
@@ -1863,21 +1899,125 @@ class LogisticRegressionSuite extends MLTest with DefaultReadWriteTest {
0.0, 0.0, 0.0, 0.09064661,
-0.1144333, 0.3204703, -0.1621061, -0.2308192,
0.0, -0.4832131, 0.0, 0.0), isTransposed = true)
- val interceptsRStd = Vectors.dense(-0.72638218, -0.01737265, 0.74375484)
+ val interceptsRStd = Vectors.dense(-0.69265374, -0.2260274, 0.9186811)
val coefficientsR = new DenseMatrix(3, 4, Array(
0.0, 0.0, 0.01641412, 0.03570376,
-0.05110822, 0.0, -0.21595670, -0.16162836,
0.0, 0.0, 0.0, 0.0), isTransposed = true)
val interceptsR = Vectors.dense(-0.44707756, 0.75180900, -0.3047314)
- assert(model1.coefficientMatrix ~== coefficientsRStd absTol 0.05)
- assert(model1.interceptVector ~== interceptsRStd relTol 0.1)
+ assert(model1.coefficientMatrix ~== coefficientsRStd absTol 1e-3)
+ assert(model1.interceptVector ~== interceptsRStd relTol 1e-3)
assert(model1.interceptVector.toArray.sum ~== 0.0 absTol eps)
- assert(model2.coefficientMatrix ~== coefficientsR absTol 0.02)
- assert(model2.interceptVector ~== interceptsR relTol 0.1)
+ assert(model2.coefficientMatrix ~== coefficientsR absTol 1e-3)
+ assert(model2.interceptVector ~== interceptsR relTol 1e-3)
assert(model2.interceptVector.toArray.sum ~== 0.0 absTol eps)
}
+ test("SPARK-34860: multinomial logistic regression with intercept, with small var") {
Review comment:
master does not pass this newly add testsuite:
```
// scalastyle:off println
println("R")
println(interceptsR)
println(coefficientsR)
println()
println("model1")
println(model1.interceptVector)
println(model1.coefficientMatrix)
println()
println("model2")
println(model2.interceptVector)
println(model2.coefficientMatrix)
println()
println("R2")
println(interceptsR2)
println(coefficientsR2)
println()
println("model3")
println(model3.interceptVector)
println(model3.coefficientMatrix)
// scalastyle:on println
```
this PR:
```
R
[2.91748298,-17.510746,14.59326301]
0.21755977 0.01647541 0.16507778 -0.1401668
-0.24436 0.7564655 -0.2955698 1.3262009
0.02680026 -0.77294095 0.13049206 -1.18603411
model1
[2.933958199942738,-17.543164024163175,14.609205824220437]
0.21812136899052606 0.015486127035160564 0.16560717317181253 -0.14189621394905397
-0.2454895541210769 0.7584152697648037 -0.2966285999752721 1.3296192946128171
0.027368185130550855 -0.7739013967999642 0.13102142680345957 -1.187723080663763
model2
[2.933958199942738,-17.543164024163175,14.609205824220437]
0.21812136899052606 0.015486127035160564 0.16560717317181253 -0.14189621394905397
-0.2454895541210769 0.7584152697648037 -0.2966285999752721 1.3296192946128171
0.027368185130550855 -0.7739013967999642 0.13102142680345957 -1.187723080663763
R2
[1.751626027,-3.9297124987,2.178086472]
0.019970169 0.079611293 0.003959452 0.110024399
-4.788494E-4 0.0010097453 -5.832701E-4 0.0
-0.01936999 -0.080851149 -0.003319687 -0.112435972
model3
[1.7516587309368687,-3.9297178332916585,2.1780591023547897]
0.019968543900064605 0.07960456424549685 0.0039592584764418055 0.11002491382872195
-4.7805989516075794E-4 0.0010124410611496804 -5.830912612961964E-4 0.0
-0.01936890596857533 -0.08084716280475213 -0.0033195486718121834 -0.1124344396230352
```
master:
```
R
[2.91748298,-17.510746,14.59326301]
0.21755977 0.01647541 0.16507778 -0.1401668
-0.24436 0.7564655 -0.2955698 1.3262009
0.02680026 -0.77294095 0.13049206 -1.18603411
model1
[3.2289115796175536,-3.8874667667006286,0.6585551870830749]
0.21614280080869921 0.010853354751576538 0.16526956599746928 -0.16826299113708829
-0.24226138413980347 0.766137782321547 -0.2961105375461299 -0.01353727702893284
0.02611858333110428 -0.7769911370731234 0.13084097154866067 0.18180026816602116
model2
[3.2289115795385817,-3.8874667667014213,0.65855518716284]
0.216142800347921 0.01085335149421333 0.1652695665789533 -0.16826299025797364
-0.24226138429694594 0.7661377826486023 -0.2961105377075671 -0.013537276769415511
0.026118583949024932 -0.7769911341428156 0.13084097112861381 0.18180026702738916
R2
[1.751626027,-3.9297124987,2.178086472]
0.019970169 0.079611293 0.003959452 0.110024399
-4.788494E-4 0.0010097453 -5.832701E-4 0.0
-0.01936999 -0.080851149 -0.003319687 -0.112435972
model3
[3.2372615840468177,-3.887368655600576,0.6501070715537581]
0.019839138236381705 0.0794011365650966 0.0039488069038510374 -0.028039490169532715
-4.7766310601985774E-4 0.001015028177410154 -5.837314941386912E-4 0.003248397753479403
-0.019272077893351464 -0.0806696209827808 -0.0033080309178124827 0.04470991419683469
```
We can see that new impl generate solution much more close to GLMNET.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809093482
**[Test build #136629 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136629/testReport)** for PR 31985 at commit [`461d111`](https://github.com/apache/spark/commit/461d1110da71d504780f5a1f7db07fceaf597938).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809066739
**[Test build #136625 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136625/testReport)** for PR 31985 at commit [`cdaafc2`](https://github.com/apache/spark/commit/cdaafc28f458d45a6f1a257b2cea381db7a09637).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809087006
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41212/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809079491
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/136625/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] srowen commented on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
srowen commented on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-810635806
Merged to master
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809042739
**[Test build #136625 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136625/testReport)** for PR 31985 at commit [`cdaafc2`](https://github.com/apache/spark/commit/cdaafc28f458d45a6f1a257b2cea381db7a09637).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809061510
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41205/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809058974
**[Test build #136629 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136629/testReport)** for PR 31985 at commit [`461d111`](https://github.com/apache/spark/commit/461d1110da71d504780f5a1f7db07fceaf597938).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809079491
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/136625/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809109301
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] srowen closed pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
srowen closed pull request #31985:
URL: https://github.com/apache/spark/pull/31985
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] zhengruifeng commented on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
zhengruifeng commented on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-810682703
@srowen Thanks for reviewing!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809058974
**[Test build #136629 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136629/testReport)** for PR 31985 at commit [`461d111`](https://github.com/apache/spark/commit/461d1110da71d504780f5a1f7db07fceaf597938).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809094769
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41205/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809109296
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809087006
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41212/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] zhengruifeng commented on a change in pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
zhengruifeng commented on a change in pull request #31985:
URL: https://github.com/apache/spark/pull/31985#discussion_r602996562
##########
File path: mllib/src/test/scala/org/apache/spark/ml/classification/LogisticRegressionSuite.scala
##########
@@ -1863,21 +1899,125 @@ class LogisticRegressionSuite extends MLTest with DefaultReadWriteTest {
0.0, 0.0, 0.0, 0.09064661,
-0.1144333, 0.3204703, -0.1621061, -0.2308192,
0.0, -0.4832131, 0.0, 0.0), isTransposed = true)
- val interceptsRStd = Vectors.dense(-0.72638218, -0.01737265, 0.74375484)
+ val interceptsRStd = Vectors.dense(-0.69265374, -0.2260274, 0.9186811)
Review comment:
Old `interceptsRStd` did not equal to GLMNET's result: [-0.69265374, -0.2260274, 0.9186811], so I think this should be a good change
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] zhengruifeng commented on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
zhengruifeng commented on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809044289
@srowen @WeichenXu123
This is the last PR for LR supporting centering
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31985: [SPARK-34860][ML] Multinomial Logistic Regression with intercept support centering
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31985:
URL: https://github.com/apache/spark/pull/31985#issuecomment-809111962
Kubernetes integration test unable to build dist.
exiting with code: 1
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41212/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org