From e97e6913042e4309e17759519a6b6cd6bdfb4c91 Mon Sep 17 00:00:00 2001 From: Bryan Cutler Date: Mon, 12 Oct 2015 21:04:45 -0700 Subject: [PATCH 1/2] [SPARK-10959] [PYSPARK] StreamingLogisticRegressionWithSGD does not train with given regParam and StreamingLinearRegressionWithSGD intercept param is not in correct position --- python/pyspark/mllib/classification.py | 3 ++- python/pyspark/mllib/regression.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/python/pyspark/mllib/classification.py b/python/pyspark/mllib/classification.py index 8f27c446a66e8..f61f30b98fe13 100644 --- a/python/pyspark/mllib/classification.py +++ b/python/pyspark/mllib/classification.py @@ -632,7 +632,8 @@ def update(rdd): if not rdd.isEmpty(): self._model = LogisticRegressionWithSGD.train( rdd, self.numIterations, self.stepSize, - self.miniBatchFraction, self._model.weights) + self.miniBatchFraction, self._model.weights, + regParam=self.regParam ) dstream.foreachRDD(update) diff --git a/python/pyspark/mllib/regression.py b/python/pyspark/mllib/regression.py index 41946e3674fbe..6bbac026507c2 100644 --- a/python/pyspark/mllib/regression.py +++ b/python/pyspark/mllib/regression.py @@ -669,7 +669,7 @@ def update(rdd): self._model = LinearRegressionWithSGD.train( rdd, self.numIterations, self.stepSize, self.miniBatchFraction, self._model.weights, - self._model.intercept) + intercept=self._model.intercept) dstream.foreachRDD(update) From 8b4eb0896f917b497794b7f5235a320cebfb2c2e Mon Sep 17 00:00:00 2001 From: Bryan Cutler Date: Mon, 12 Oct 2015 21:24:15 -0700 Subject: [PATCH 2/2] [SPARK-10959] Fixed whitespace typo --- python/pyspark/mllib/classification.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyspark/mllib/classification.py b/python/pyspark/mllib/classification.py index f61f30b98fe13..e4500a0bc8315 100644 --- a/python/pyspark/mllib/classification.py +++ b/python/pyspark/mllib/classification.py @@ -633,7 +633,7 @@ def update(rdd): self._model = LogisticRegressionWithSGD.train( rdd, self.numIterations, self.stepSize, self.miniBatchFraction, self._model.weights, - regParam=self.regParam ) + regParam=self.regParam) dstream.foreachRDD(update)