Github user yanboliang commented on a diff in the pull request: https://github.com/apache/spark/pull/16017#discussion_r89715218 --- Diff: mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala --- @@ -52,33 +52,49 @@ class DecisionTreeClassifier @Since("1.4.0") ( // Override parameter setters from parent trait for Java API compatibility. + /** @group setParam */ @Since("1.4.0") - override def setMaxDepth(value: Int): this.type = super.setMaxDepth(value) + override def setMaxDepth(value: Int): this.type = set(maxDepth, value) + /** @group setParam */ @Since("1.4.0") - override def setMaxBins(value: Int): this.type = super.setMaxBins(value) + override def setMaxBins(value: Int): this.type = set(maxBins, value) + /** @group setParam */ @Since("1.4.0") - override def setMinInstancesPerNode(value: Int): this.type = - super.setMinInstancesPerNode(value) + override def setMinInstancesPerNode(value: Int): this.type = set(minInstancesPerNode, value) + /** @group setParam */ @Since("1.4.0") - override def setMinInfoGain(value: Double): this.type = super.setMinInfoGain(value) + override def setMinInfoGain(value: Double): this.type = set(minInfoGain, value) + /** @group expertSetParam */ @Since("1.4.0") - override def setMaxMemoryInMB(value: Int): this.type = super.setMaxMemoryInMB(value) + override def setMaxMemoryInMB(value: Int): this.type = set(maxMemoryInMB, value) + /** @group expertSetParam */ @Since("1.4.0") - override def setCacheNodeIds(value: Boolean): this.type = super.setCacheNodeIds(value) + override def setCacheNodeIds(value: Boolean): this.type = set(cacheNodeIds, value) + /** + * Specifies how often to checkpoint the cached node IDs. + * E.g. 10 means that the cache will get checkpointed every 10 iterations. + * This is only used if cacheNodeIds is true and if the checkpoint directory is set in + * [[org.apache.spark.SparkContext]]. + * Must be >= 1. + * (default = 10) + * @group setParam --- End diff -- The cause of this change was suggested at https://github.com/apache/spark/pull/15913#discussion_r89662469 , since Param setter methods in traits used to have the wrong type in Java. We would like to remove the setter method from the trait since it does not make sense to have it in the Model classes. We could put the setter method in each subclass and then deprecate the method in the Model classes. So if we remove the setter method from the traits, we can not inherit docs from them. BTW, the current change is consistent with other ML algorithms which inherit traits.
--- 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