Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/2435#discussion_r18014914
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/tree/impl/DecisionTreeMetadata.scala
---
@@ -128,13 +139,34 @@ private[tree] object DecisionTreeMetadata {
}
}
+ // Set number of features to use per node (for random forests).
+ val _featureSubsetStrategy = featureSubsetStrategy match {
+ case "auto" => if (numTrees == 1) "all" else "sqrt"
+ case _ => featureSubsetStrategy
+ }
+ val numFeaturesPerNode: Int = _featureSubsetStrategy match {
+ case "all" => numFeatures
+ case "sqrt" => math.sqrt(numFeatures).ceil.toInt
+ case "log2" => math.max(1, (math.log(numFeatures) /
math.log(2)).ceil.toInt)
--- End diff --
OK, I'll keep 1/3. Would you recommend using a warning when log2 or sqrt
are used? Or I could remove log2, and make the user specify something that
strict manually (assuming we later add support for parsing arbitrary numerical
values given for this parameter).
---
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]