Skip to content

Commit

Permalink
fix scalastyle
Browse files Browse the repository at this point in the history
  • Loading branch information
jackylk committed Jan 30, 2015
1 parent 93f3280 commit ec21f7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
9 changes: 6 additions & 3 deletions mllib/src/main/scala/org/apache/spark/mllib/fpm/FPTree.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit ec21f7d

Please sign in to comment.