huaxingao commented on a change in pull request #28786:
URL: https://github.com/apache/spark/pull/28786#discussion_r438331048



##########
File path: 
mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
##########
@@ -594,7 +594,7 @@ class LogisticRegression @Since("1.2.0") (
         Vectors.dense(if (numClasses == 2) Double.PositiveInfinity else 
Double.NegativeInfinity)
       }
       if (instances.getStorageLevel != StorageLevel.NONE) instances.unpersist()
-      return createModel(dataset, numClasses, coefMatrix, interceptVec, 
Array.empty)
+      return createModel(dataset, numClasses, coefMatrix, interceptVec, 
Array(0.0))

Review comment:
       When training is not needed, LinearRegression set objectiveHistory to 
Array(0.0). 
https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala#L511
   I think LogisticRegression should have the same bahavior. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to