是否可以在mysql语句中运行先验关联规则? [英] Is it possible to run apriori association rule in mysql statement?
问题描述
数据库:
Transacation# Items List
T1 butter
T1 jam
T2 butter
T3 bread
T3 ice cream
T4 butter
T4 jam
在上表中,mysql 语句中是否可以运行先验关联规则?
In the above table, Is it possible to run apriori association rule in mysql statement?
比如buys(T,butter)-->buys(T, jam)=50%的支持
For example, the support of buys(T, butter) --> buys(T, jam) = 50%
因为有 4 个事务并且 T1、T4 满足支持"规则.
because there are 4 transactions and T1, T4 satisfy "support" rule.
我可以只用一个sql语句来找出这样的结果吗?
Can i just use a sql statement to find out such result?
推荐答案
是的,您可以使用 SQL 查找单个项目的支持.但是如果你想找到包含多个项的项集,那就很困难了.
Yes, you can use SQL to find the support of a single item. But if you want to find itemsets containing more than one item, it would be difficult.
例如,如果您有包含多个项目的交易,并且您想找到牛奶"和面包"一起出现的果酱"的支持,那么最好使用像Apriori这样的算法,或者更快的算法就像 FPGrowth.
For example, if you had transactions containing several items and you want to find the support of "jam" with "milk" and "bread" appearing together, then it is better to use an algorithm like Apriori, or a faster algorithm like FPGrowth.
这篇关于是否可以在mysql语句中运行先验关联规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!