aboutsummaryrefslogtreecommitdiff
path: root/mllib/src/main
diff options
context:
space:
mode:
authorChristoph Sawade <christoph@sawade.me>2014-09-15 17:39:31 -0700
committerXiangrui Meng <meng@databricks.com>2014-09-15 17:39:31 -0700
commit3b93128139e8d303f1d7bfd04e9a99a11a5b6404 (patch)
treea1239e81d6fae05f8727439080e7ce4f0f936de5 /mllib/src/main
parent37d925280cdfdda8f6f7174c67a614056eea5d69 (diff)
downloadspark-3b93128139e8d303f1d7bfd04e9a99a11a5b6404.tar.gz
spark-3b93128139e8d303f1d7bfd04e9a99a11a5b6404.tar.bz2
spark-3b93128139e8d303f1d7bfd04e9a99a11a5b6404.zip
[SPARK-3396][MLLIB] Use SquaredL2Updater in LogisticRegressionWithSGD
SimpleUpdater ignores the regularizer, which leads to an unregularized LogReg. To enable the common L2 regularizer (and the corresponding regularization parameter) for logistic regression the SquaredL2Updater has to be used in SGD (see, e.g., [SVMWithSGD]) Author: Christoph Sawade <christoph@sawade.me> Closes #2398 from BigCrunsh/fix-regparam-logreg and squashes the following commits: 0820c04 [Christoph Sawade] Use SquaredL2Updater in LogisticRegressionWithSGD
Diffstat (limited to 'mllib/src/main')
-rw-r--r--mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala b/mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala
index 486bdbfa9c..84d3c7cebd 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala
@@ -84,7 +84,7 @@ class LogisticRegressionWithSGD private (
extends GeneralizedLinearAlgorithm[LogisticRegressionModel] with Serializable {
private val gradient = new LogisticGradient()
- private val updater = new SimpleUpdater()
+ private val updater = new SquaredL2Updater()
override val optimizer = new GradientDescent(gradient, updater)
.setStepSize(stepSize)
.setNumIterations(numIterations)