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

    https://github.com/apache/spark/pull/9008#discussion_r41573997
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/tree/impl/RandomForest.scala ---
    @@ -1211,4 +1212,34 @@ 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]]
    +   */
    +  private[impl] def buildWeightedMetadata(
    +      input: RDD[WeightedLabeledPoint],
    +      strategy: OldStrategy,
    +      numTrees: Int,
    +      featureSubsetStrategy: String) = {
    --- End diff --
    
    Should specify return type here.
    
    Is the reason that you can't just modify `buildMetadata` to accept and 
`RDD[WeightedLabeledPoint]` because you are trying not to change MLlib 
implementation?


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