Github user chouqin commented on a diff in the pull request:
https://github.com/apache/spark/pull/1950#discussion_r16281396
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala ---
@@ -53,16 +55,28 @@ class DecisionTree (private val strategy: Strategy)
extends Serializable with Lo
*/
def train(input: RDD[LabeledPoint]): DecisionTreeModel = {
+ val timer = new TimeTracker()
+
+ timer.start("total")
+
// Cache input RDD for speedup during multiple passes.
- val retaggedInput = input.retag(classOf[LabeledPoint]).cache()
+ timer.start("init")
+ val retaggedInput = input.retag(classOf[LabeledPoint])
logDebug("algo = " + strategy.algo)
+ timer.stop("init")
// Find the splits and the corresponding bins (interval between the
splits) using a sample
// of the input data.
+ timer.start("findSplitsBins")
val (splits, bins) = DecisionTree.findSplitsBins(retaggedInput,
strategy)
val numBins = bins(0).length
+ timer.stop("findSplitsBins")
logDebug("numBins = " + numBins)
+ timer.start("init")
+ val treeInput = TreePoint.convertToTreeRDD(retaggedInput, strategy,
bins).cache()
+ timer.stop("init")
--- End diff --
I think the timer for `convertToTreeRDD` may not be useful, since the `map`
from `retaggedInput` to `treeInput` is evaluated lazily.
---
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]