Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update doc
  • Loading branch information
zhengruifeng committed Jan 3, 2020
commit e3d9200add19e30417775395465b7da38ac2dee3
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,11 @@ private[spark] object RandomForest extends Logging with Serializable {
}

/**
* Train a random forest.
* Train a random forest with metadata. This method is mainly for GBT, in which metadata can
* be reused among trees.
*
* @param input Training data: RDD of `Instance`
* @param metadata Learning and dataset metadata for DecisionTree.
* @return an unweighted set of trees
*/
def runWithMetadata(
Expand Down Expand Up @@ -590,7 +592,7 @@ private[spark] object RandomForest extends Logging with Serializable {

// transform nodeStatsAggregators array to (nodeIndex, nodeAggregateStats) pairs,
// which can be combined with other partition using `reduceByKey`
nodeStatsAggregators.view.zipWithIndex.map(_.swap).iterator
nodeStatsAggregators.iterator.zipWithIndex.map(_.swap)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDEA editor always shows warnings on the two lines, change them to avoid warnings.

}
} else {
input.mapPartitions { points =>
Expand All @@ -608,7 +610,7 @@ private[spark] object RandomForest extends Logging with Serializable {

// transform nodeStatsAggregators array to (nodeIndex, nodeAggregateStats) pairs,
// which can be combined with other partition using `reduceByKey`
nodeStatsAggregators.view.zipWithIndex.map(_.swap).iterator
nodeStatsAggregators.iterator.zipWithIndex.map(_.swap)
}
}

Expand Down