Skip to content

Commit

Permalink
[SPARK-6080] [PySpark] correct LogisticRegressionWithLBFGS regType pa…
Browse files Browse the repository at this point in the history
…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 <[email protected]>

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 <[email protected]>
  • Loading branch information
yanboliang authored and mengxr committed Mar 2, 2015
1 parent f476108 commit 4ffaf85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/pyspark/mllib/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def train(cls, data, iterations=100, initialWeights=None, regParam=0.01, regType
"""
def train(rdd, i):
return callMLlibFunc("trainLogisticRegressionModelWithLBFGS", rdd, int(iterations), i,
float(regParam), str(regType), bool(intercept), int(corrections),
float(regParam), regType, bool(intercept), int(corrections),
float(tolerance))

return _regression_train_wrapper(train, LogisticRegressionModel, data, initialWeights)
Expand Down

0 comments on commit 4ffaf85

Please sign in to comment.