zhengruifeng created SPARK-13506:
------------------------------------
Summary: Fix the wrong parameter in R code comment in
AssociationRulesSuite
Key: SPARK-13506
URL: https://issues.apache.org/jira/browse/SPARK-13506
Project: Spark
Issue Type: Bug
Components: MLlib
Reporter: zhengruifeng
Priority: Trivial
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(x) 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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]