aboutsummaryrefslogtreecommitdiff
path: root/mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala
diff options
context:
space:
mode:
authorBertrand Dechoux <BertrandDechoux@users.noreply.github.com>2015-09-14 09:18:46 +0100
committerSean Owen <sowen@cloudera.com>2015-09-14 09:18:46 +0100
commitd81565465cc6d4f38b4ed78036cded630c700388 (patch)
tree7a5084534ae25f360469aa7e86546c268ae174df /mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala
parent1dc614b874badde0eee60def46fb47f608bc4759 (diff)
downloadspark-d81565465cc6d4f38b4ed78036cded630c700388.tar.gz
spark-d81565465cc6d4f38b4ed78036cded630c700388.tar.bz2
spark-d81565465cc6d4f38b4ed78036cded630c700388.zip
[SPARK-9720] [ML] Identifiable types need UID in toString methods
A few Identifiable types did override their toString method but without using the parent implementation. As a consequence, the uid was not present anymore in the toString result. It is the default behaviour. This patch is a quick fix. The question of enforcement is still up. No tests have been written to verify the toString method behaviour. That would be long to do because all types should be tested and not only those which have a regression now. It is possible to enforce the condition using the compiler by making the toString method final but that would introduce unwanted potential API breaking changes (see jira). Author: Bertrand Dechoux <BertrandDechoux@users.noreply.github.com> Closes #8062 from BertrandDechoux/SPARK-9720.
Diffstat (limited to 'mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala')
-rw-r--r--mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala b/mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala
index 0a75d5d222..b8eb49f9bd 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala
@@ -146,7 +146,7 @@ final class DecisionTreeClassificationModel private[ml] (
}
override def toString: String = {
- s"DecisionTreeClassificationModel of depth $depth with $numNodes nodes"
+ s"DecisionTreeClassificationModel (uid=$uid) of depth $depth with $numNodes nodes"
}
/** (private[ml]) Convert to a model in the old API */