我是 R 的新手,我有一个来自 CSV 文件的大型数据库的练习 1360 行 255 列,需要应用先验 问题是,当我这样做以获得关联规则列表时,升力总是最终为 1 并且频率图相同,它们都是 1 我在我的代码中做错了什么还是因为 csv 文件?
summary(data_rules)
set of 8258175 rules
rule length distribution (lhs + rhs):sizes
2 3
64770 8193405
Min. 1st Qu. Median Mean 3rd Qu. Max.
2.000 3.000 3.000 2.992 3.000 3.000
summary of quality measures:
support confidence coverage lift count
Min. :1 Min. :1 Min. :1 Min. :1 Min. :1361
1st Qu.:1 1st Qu.:1 1st Qu.:1 1st Qu.:1 1st Qu.:1361
Median :1 Median :1 Median :1 Median :1 Median :1361
Mean :1 Mean :1 Mean :1 Mean :1 Mean :1361
3rd Qu.:1 3rd Qu.:1 3rd Qu.:1 3rd Qu.:1 3rd Qu.:1361
Max. :1 Max. :1 Max. :1 Max. :1 Max. :1361
mining info:
data ntransactions support confidence
df_transaction 1361 0.01 0.5
call
apriori(data = df_transaction, parameter = list(support = 0.01, confidence = 0.5, minlen = 2, maxlen = 3))
> inspect(head(data_rules,10))
lhs rhs support confidence coverage lift count
[1] {Hair.Conditioner=[0,1]} => {Chardonnay=[0,1]} 1 1 1 1 1361
[2] {Chardonnay=[0,1]} => {Hair.Conditioner=[0,1]} 1 1 1 1 1361
[3] {Hair.Conditioner=[0,1]} => {Sunglasses=[0,1]} 1 1 1 1 1361
[4] {Sunglasses=[0,1]} => {Hair.Conditioner=[0,1]} 1 1 1 1 1361
[5] {Hair.Conditioner=[0,1]} => {Turkey.Noodle.Soup=[0,1]} 1 1 1 1 1361
[6] {Turkey.Noodle.Soup=[0,1]} => {Hair.Conditioner=[0,1]} 1 1 1 1 1361
[7] {Hair.Conditioner=[0,1]} => {Frozen.Carrots=[0,1]} 1 1 1 1 1361
[8] {Frozen.Carrots=[0,1]} => {Hair.Conditioner=[0,1]} 1 1 1 1 1361
[9] {Hair.Conditioner=[0,1]} => {Bananas=[0,1]} 1 1 1 1 1361
[10] {Bananas=[0,1]} => {Hair.Conditioner=[0,1]} 1 1 1 1 1361 `
解释为什么电梯总是 1
的解决方案