zhengruifeng commented on a change in pull request #29255:
URL: https://github.com/apache/spark/pull/29255#discussion_r461270045



##########
File path: 
mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
##########
@@ -1100,14 +1100,45 @@ class LogisticRegressionModel private[spark] (
 
   private lazy val _intercept = interceptVector.toArray.head
 
+  private lazy val _interceptVector = interceptVector.toDense
+
+  private var _threshold = Double.NaN
+
+  private var _rawThreshold = Double.NaN
+
+  {
+    updateThreshold()
+  }
+
+  private def updateThreshold(): Unit = {
+    if (!isMultinomial) {

Review comment:
       @srowen @huaxingao this change is only for binary classification. I 
found there is not similar place to change for the multinomial case.

##########
File path: 
mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
##########
@@ -1100,14 +1100,45 @@ class LogisticRegressionModel private[spark] (
 
   private lazy val _intercept = interceptVector.toArray.head
 
+  private lazy val _interceptVector = interceptVector.toDense
+
+  private var _threshold = Double.NaN
+
+  private var _rawThreshold = Double.NaN
+
+  {
+    updateThreshold()
+  }
+
+  private def updateThreshold(): Unit = {
+    if (!isMultinomial) {

Review comment:
       for multinomial case, it seems should be modified in 
`ProbabilisticClassifier`.
   
   I will study whether similar change in  `ProbabilisticClassifier` can help 
improve performance in all `ProbabilisticClassificationModel` including 
multinomial logistic regression.




----------------------------------------------------------------
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