srowen commented on a change in pull request #26972: [SPARK-30321][Ml] Log 
weightSum in Algo that has weights support
URL: https://github.com/apache/spark/pull/26972#discussion_r360658499
 
 

 ##########
 File path: 
mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala
 ##########
 @@ -126,6 +126,8 @@ class DecisionTreeClassifier @Since("1.4.0") (
     }
     validateNumClasses(numClasses)
     val instances = extractInstances(dataset, numClasses)
+    val weightSum = instances.map(_.weight).reduce(_ + _)
 
 Review comment:
   Hm, on second thought, this requires an extra pass to compute the weights. 
Is it worth it? is there any other place to get this info instead without 
adding a Spark job?

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


With regards,
Apache Git Services

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

Reply via email to