Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/14547#discussion_r75523854
--- Diff: mllib/src/main/scala/org/apache/spark/ml/tree/treeParams.scala ---
@@ -183,24 +191,18 @@ private[ml] trait DecisionTreeParams extends
PredictorParams
*/
private[ml] trait TreeClassifierParams extends Params {
+ // Impurity should be overriden when setting a default. This should be a
def, but has
+ // to be a val to maintain the proper documentation.
/**
- * Criterion used for information gain calculation (case-insensitive).
- * Supported: "entropy" and "gini".
- * (default = gini)
* @group param
*/
- final val impurity: Param[String] = new Param[String](this, "impurity",
"Criterion used for" +
- " information gain calculation (case-insensitive). Supported options:"
+
- s" ${TreeClassifierParams.supportedImpurities.mkString(", ")}",
- (value: String) =>
TreeClassifierParams.supportedImpurities.contains(value.toLowerCase))
-
- setDefault(impurity -> "gini")
+ val impurity: Param[String] = new Param(this, "", "")
/** @group setParam */
def setImpurity(value: String): this.type = set(impurity, value)
/** @group getParam */
- final def getImpurity: String = $(impurity).toLowerCase
+ def getImpurity: String = $(impurity).toLowerCase
--- End diff --
why not final?
---
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]