使用 SPARK 从关联规则中提取提升和支持
Extract the Lift and Support from Association Rules using SPARK
我正在使用频繁模式挖掘算法 - 关联规则:
import org.apache.spark.mllib.fpm.AssociationRules
import org.apache.spark.mllib.fpm.FPGrowth.FreqItemset
val freqItemsets = sc.parallelize(Seq(
new FreqItemset(Array("a"), 15L),
new FreqItemset(Array("b"), 35L),
new FreqItemset(Array("a", "b"), 12L)
))
val ar = new AssociationRules()
.setMinConfidence(0.8)
val results = ar.run(freqItemsets)
results.collect().foreach { rule =>
println("[" + rule.antecedent.mkString(",")
+ "=>"
+ rule.consequent.mkString(",") + "]," + rule.confidence)
}
我的问题是:
是否可以提取规则的支撑和提升?我只是得到了信心...
非常感谢!
当前编号
有两张 JIRA 票。
参见:
关于电梯SPARK-10697
Adding Lift Calculation in Association Rule mining
关于支持SPARK-15938
Adding Support Calculation in Association Rule mining
我正在使用频繁模式挖掘算法 - 关联规则:
import org.apache.spark.mllib.fpm.AssociationRules
import org.apache.spark.mllib.fpm.FPGrowth.FreqItemset
val freqItemsets = sc.parallelize(Seq(
new FreqItemset(Array("a"), 15L),
new FreqItemset(Array("b"), 35L),
new FreqItemset(Array("a", "b"), 12L)
))
val ar = new AssociationRules()
.setMinConfidence(0.8)
val results = ar.run(freqItemsets)
results.collect().foreach { rule =>
println("[" + rule.antecedent.mkString(",")
+ "=>"
+ rule.consequent.mkString(",") + "]," + rule.confidence)
}
我的问题是:
是否可以提取规则的支撑和提升?我只是得到了信心...
非常感谢!
当前编号 有两张 JIRA 票。
参见:
关于电梯SPARK-10697
Adding Lift Calculation in Association Rule mining
关于支持SPARK-15938
Adding Support Calculation in Association Rule mining