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

    https://github.com/apache/spark/pull/9008#discussion_r53089894
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/tree/impl/RandomForest.scala ---
    @@ -1171,4 +1173,28 @@ private[ml] object RandomForest extends Logging {
         }
       }
     
    +  /**
    +   * Inject the sample weight to sub-sample weights of the baggedPoints
    +   */
    +  private[impl] def reweightSubSampleWeights(
    +      baggedTreePoints: RDD[BaggedPoint[TreePoint]]): 
RDD[BaggedPoint[TreePoint]] = {
    +    baggedTreePoints.map {bagged =>
    +      val treePoint = bagged.datum
    +      val adjustedSubSampleWeights = bagged.subsampleWeights.map(w => w * 
treePoint.weight)
    +      new BaggedPoint[TreePoint](treePoint, adjustedSubSampleWeights)
    +    }
    +  }
    +
    +  /**
    +   * A thin adaptor to 
[[org.apache.spark.mllib.tree.impl.DecisionTreeMetadata.buildMetadata]]
    --- End diff --
    
    nit: "adaptor" -> "adapter". I'm not sure it is currently _incorrect_ but 
"adapter" is the significantly more common spelling.


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