Repository: spark Updated Branches: refs/heads/master 6f94d56a9 -> 299b43992
[SPARK-10778] [MLLIB] Implement toString for AssociationRules.Rule I implemented toString for AssociationRules.Rule, format like `[x, y] => {z}: 1.0` Author: y-shimizu <y.shimizu0...@gmail.com> Closes #8904 from y-shimizu/master. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/299b4399 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/299b4399 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/299b4399 Branch: refs/heads/master Commit: 299b439920f980cce4c4f4e4a8436a5145efeaa3 Parents: 6f94d56 Author: y-shimizu <y.shimizu0...@gmail.com> Authored: Sun Sep 27 16:36:03 2015 +0100 Committer: Sean Owen <so...@cloudera.com> Committed: Sun Sep 27 16:36:03 2015 +0100 ---------------------------------------------------------------------- .../scala/org/apache/spark/mllib/fpm/AssociationRules.scala | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/299b4399/mllib/src/main/scala/org/apache/spark/mllib/fpm/AssociationRules.scala ---------------------------------------------------------------------- diff --git a/mllib/src/main/scala/org/apache/spark/mllib/fpm/AssociationRules.scala b/mllib/src/main/scala/org/apache/spark/mllib/fpm/AssociationRules.scala index 95c688c..07eb750 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/fpm/AssociationRules.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/fpm/AssociationRules.scala @@ -142,5 +142,10 @@ object AssociationRules { def javaConsequent: java.util.List[Item] = { consequent.toList.asJava } + + override def toString: String = { + s"${antecedent.mkString("{", ",", "}")} => " + + s"${consequent.mkString("{", ",", "}")}: ${confidence}" + } } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org