Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-13506

Fix the wrong parameter in R code comment in AssociationRulesSuite

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • None
    • 2.0.0
    • MLlib
    • None

    Description

      The following R Snippet in AssociationRulesSuite is wrong:

      /* Verify results using the `R` code:
      transactions = as(sapply(
      list("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"),
      FUN=function strsplit(x," ",fixed=TRUE)),
      "transactions")
      ars = apriori(transactions,
      parameter = list(support = 0.0, confidence = 0.5, target="rules", minlen=2))
      arsDF = as(ars, "data.frame")
      arsDF$support = arsDF$support * length(transactions)
      names(arsDF)[names(arsDF) == "support"] = "freq"
      > nrow(arsDF)
      [1] 23
      > sum(arsDF$confidence == 1)
      [1] 23
      */

      The real outputs are:
      > nrow(arsDF)
      [1] 441838
      > sum(arsDF$confidence == 1)
      [1] 441592

      It is found that the parameters in apriori function were wrong.

      Attachments

        Activity

          People

            podongfeng Ruifeng Zheng
            podongfeng Ruifeng Zheng
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: