Skip to content

Commit 9f1286b

Browse files
author
Omede Firouz
committed
[SPARK-6705][MLLIB] Add fitInterceptTerm to LogisticRegression
Whoops, add this to the logisticRegression and not the optimizer
1 parent 1d6bd6f commit 9f1286b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ class LogisticRegression
7070
}
7171

7272
// Train model
73-
val lr = new LogisticRegressionWithLBFGS
73+
val lr = new LogisticRegressionWithLBFGS()
74+
.setIntercept(paramMap(fitIntercept))
7475
lr.optimizer
7576
.setRegParam(paramMap(regParam))
7677
.setNumIterations(paramMap(maxIter))
77-
.addIntercept(paramMap(fitIntercept))
7878
val oldModel = lr.run(oldDataset)
7979
val lrm = new LogisticRegressionModel(this, paramMap, oldModel.weights, oldModel.intercept)
8080

0 commit comments

Comments
 (0)