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

    https://github.com/apache/spark/pull/12536#discussion_r60618432
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala
 ---
    @@ -94,17 +94,33 @@ final class DecisionTreeClassifier @Since("1.4.0") (
         }
         val oldDataset: RDD[LabeledPoint] = extractLabeledPoints(dataset)
         val strategy = getOldStrategy(categoricalFeatures, numClasses)
    +
    +    val instr = Instrumentation.create(this, oldDataset)
    +    instr.logParams(params: _*)
    +
         val trees = RandomForest.run(oldDataset, strategy, numTrees = 1, 
featureSubsetStrategy = "all",
           seed = $(seed), parentUID = Some(uid))
    -    trees.head.asInstanceOf[DecisionTreeClassificationModel]
    +
    +    instr.logNumFeatures(oldDataset.first().features.size)
    --- End diff --
    
    Doing it here causes some potential performance issues, because you 
materialize the 1st data partition but you do not cache it. I think it will be 
easier to log this in `RandomForest.run()` (and pass the instrumentation as an 
extra argument), so that this is done after `baggedInput`


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