diff --git a/mllib/src/main/scala/org/apache/spark/mllib/fpm/FPGrowth.scala b/mllib/src/main/scala/org/apache/spark/mllib/fpm/FPGrowth.scala index 71e66392d64ba..8f8a24f2462d1 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/fpm/FPGrowth.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/fpm/FPGrowth.scala @@ -29,11 +29,11 @@ import org.apache.spark.rdd.RDD * This class implements Parallel FP-growth algorithm to do frequent pattern matching on input data. * Parallel FPGrowth (PFP) partitions computation in such a way that each machine executes an * independent group of mining tasks. More detail of this algorithm can be found at - * [[http://dx.doi.org/10.1145/1454008.1454027, PFP]], and the original FP-growth paper can be found at - * [[http://dx.doi.org/10.1145/335191.335372, FP-growth]] + * [[http://dx.doi.org/10.1145/1454008.1454027, PFP]], and the original FP-growth paper can be + * found at [[http://dx.doi.org/10.1145/335191.335372, FP-growth]] * - * @param minSupport the minimal support level of the frequent pattern, any pattern appears more than - * (minSupport * size-of-the-dataset) times will be output + * @param minSupport the minimal support level of the frequent pattern, any pattern appears + * more than (minSupport * size-of-the-dataset) times will be output */ class FPGrowth private(private var minSupport: Double) extends Logging with Serializable { diff --git a/mllib/src/main/scala/org/apache/spark/mllib/fpm/FPTree.scala b/mllib/src/main/scala/org/apache/spark/mllib/fpm/FPTree.scala index 2dc2631d55232..ef37bf17cb351 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/fpm/FPTree.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/fpm/FPTree.scala @@ -64,7 +64,8 @@ class FPTree extends Serializable { * @return root node after merge */ private def mergeTree(tree1: FPTreeNode, tree2: FPTreeNode): FPTreeNode = { - // firstly merge two roots, then iterate on the second tree, merge all children of it to the first tree + // firstly merge two roots, then iterate on the second tree, merge all + // children of it to the first tree require(tree1 != null) require(tree2 != null) if (!tree2.isRoot) { @@ -108,7 +109,8 @@ class FPTree extends Serializable { } /** - * This function will walk through the tree and build all conditional pattern base out of it + * This function will walk through the tree and build all conditional pattern + * base out of it * @param tree the tree to expand * @return conditional pattern base */ @@ -187,7 +189,8 @@ class FPTree extends Serializable { val lineCom = v.toList.combinations(k) lineComListBuffer ++= lineCom.toList } else { - /* if each value length > k,it need calculate the intersect of each value & before combinations */ + // if each value length > k,it need calculate the intersect of each + // value & before combinations val union_lineComListTemp2v = v intersect lineComListTempBuffer.toArray.array // calculate each value combinations after intersect if (union_lineComListTemp2v.length >= k) {