Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6997#discussion_r33359216
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/mllib/fpm/FPGrowthSuite.scala ---
    @@ -61,17 +63,49 @@ class FPGrowthSuite extends SparkFunSuite with 
MLlibTestSparkContext {
         val model2 = fpg
           .setMinSupport(0.3)
           .setNumPartitions(4)
    +      .setOrdered(false)
           .run(rdd)
         assert(model2.freqItemsets.count() === 54)
     
         val model1 = fpg
           .setMinSupport(0.1)
           .setNumPartitions(8)
    +      .setOrdered(false)
           .run(rdd)
         assert(model1.freqItemsets.count() === 625)
       }
     
    -  test("FP-Growth using Int type") {
    +  test("FP-Growth frequent sequences using String type"){
    +    val transactions = Seq(
    +      "r z h k p",
    +      "z y x w v u t s",
    +      "s x o n r",
    +      "x z y m t s q e",
    +      "z",
    +      "x z y r q t p")
    +      .map(_.split(" "))
    +    val rdd = sc.parallelize(transactions, 2).cache()
    +
    +    val fpg = new FPGrowth()
    +
    +    val model1 = fpg
    +      .setMinSupport(0.5)
    +      .setNumPartitions(2)
    +      .setOrdered(true)
    +      .run(rdd)
    +
    +    val expected = Set(
    --- End diff --
    
    If you compared the output with R, could you put the R statements that 
generate the same result in comment? For example,
    
    
https://github.com/apache/spark/blob/master/mllib/src/test/scala/org/apache/spark/ml/classification/LogisticRegressionSuite.scala#L504
    
    But do not use JavaDoc comment, use multiline comments without the leading 
`*` on each line. So people can easily copy & paste the commands into R:
    
    ~~~
    /*
      library("glmnet")
      data <- read.csv("path", header=FALSE)
      label = factor(data$V1)
      features = as.matrix(data.frame(data$V2, data$V3, data$V4, data$V5))
      weights = coef(glmnet(features,label, family="binomial", alpha = 1.0, 
lambda = 6.0))
      weights
     */
    ~~~


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to