Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6300#discussion_r30766001
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/classification/RandomForestClassifier.scala
 ---
    @@ -134,13 +136,28 @@ final class RandomForestClassificationModel 
private[ml] (
     
       override def treeWeights: Array[Double] = _treeWeights
     
    +  override def transform(dataset: DataFrame): DataFrame = {
    +    val bcastModel = dataset.sqlContext.sparkContext.broadcast(this)
    +    transformImpl(dataset, bcastModel)
    +  }
    +
       override protected def predict(features: Vector): Double = {
    -    // TODO: Override transform() to broadcast model.  SPARK-7127
         // TODO: When we add a generic Bagging class, handle transform there: 
SPARK-7128
    +    // Predict without using a broadcasted mode
    +    predictImpl(features, () => this)
    --- End diff --
    
    Yes, we will want to.  If it's a small model, then it can be faster to not 
broadcast it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to