Uh oh!
There was an error while loading. Please reload this page.
[SPARK-6080] [PySpark] correct LogisticRegressionWithLBFGS regType parameter for pyspark - #4831
[SPARK-6080] [PySpark] correct LogisticRegressionWithLBFGS regType parameter for pyspark#4831yanboliang wants to merge 1 commit into
Conversation
AmplabJenkins
commented
Feb 28, 2015
Can one of the admins verify this patch? |
mengxr
commented
Mar 1, 2015
add to whitelist |
mengxr
commented
Mar 1, 2015
ok to test |
SparkQA
commented
Mar 1, 2015
Test build #28150 has started for PR 4831 at commit
|
There was a problem hiding this comment.
Shall we use str(regType) if regType else None?
There was a problem hiding this comment.
I think directly use regType is enough, because py4j can translate "l1","l2",None in Python to "l1","l2",null in Java/Scala smoothly.
I found the peer functions LogisticRegressionWithSGD and SVMWithSGD also directly use regType and it can work well.
There was a problem hiding this comment.
The difference is the error message. If we use str(...), the Java function call would be successful and inside the Java function, we say the input regType is not recognized.
If we don't use str(..), if users input something like 1, 2. Py4j will throw an error saying there is no Java function matching the input signature, which usually confuses users.
Anyway, this is a minor issue for regType.
SparkQA
commented
Mar 1, 2015
Test build #28150 has finished for PR 4831 at commit
|
AmplabJenkins
commented
Mar 1, 2015
Test PASSed. |
mengxr
commented
Mar 2, 2015
LGTM. Merged into master and branch-1.3. Thanks! |
…rameter for pyspark Currently LogisticRegressionWithLBFGS in python/pyspark/mllib/classification.py will invoke callMLlibFunc with a wrong "regType" parameter. It was assigned to "str(regType)" which translate None(Python) to "None"(Java/Scala). The right way should be translate None(Python) to null(Java/Scala) just as what we did at LogisticRegressionWithSGD. Author: Yanbo Liang <ybliang8@gmail.com> Closes#4831 from yanboliang/pyspark_classification and squashes the following commits: 12db65a [Yanbo Liang] correct LogisticRegressionWithLBFGS regType parameter for pyspark (cherry picked from commit af2effd) Signed-off-by: Xiangrui Meng <meng@databricks.com>
Currently LogisticRegressionWithLBFGS in python/pyspark/mllib/classification.py will invoke callMLlibFunc with a wrong "regType" parameter.
It was assigned to "str(regType)" which translate None(Python) to "None"(Java/Scala). The right way should be translate None(Python) to null(Java/Scala) just as what we did at LogisticRegressionWithSGD.