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

    https://github.com/apache/spark/pull/2435#discussion_r18008890
  
    --- 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 --
    
    sqrt and log2 are used in scikit-learn.  I have not seen onethird.  I'd be 
OK with removing it.  (Can you also please check out the comments above about 
this?  It would be good to know if I should go ahead and include more options 
for this parameter, and also if I should rename the parameter to match another 
library.  Thanks!)


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to