我正在执行关联规则,并且所有支持置信度Coververage和lift的输出均为1。我做错了什么?
数据集:https://github.com/Tesla-Republic/cosmetic/blob/master/Cosmetics.csv
Cosmetics_df <- read_csv("attached_file")
head(Cosmetics_df)
Cosmetics_df <- Cosmetics_df[,c(-1)]
summary(Cosmetics_df)
Cosmetics_trans <- as(Cosmetics_df,"transactions")
inspect(Cosmetics_trans)
rule1 <- apriori(Cosmetics_trans,parameter = list(supp = 0.2,conf = 0.5,target = "rules"))
inspect(head(sort(rule1,by = "lift",decreasing = T),5))
这是输出:
lhs rhs support confidence coverage lift count
[1] {} => {Bag=[0,1]} 1 1 1 1 1000
[2] {} => {Blush=[0,1]} 1 1 1 1 1000
[3] {} => {Nail Polish=[0,1]} 1 1 1 1 1000
[4] {} => {brushes=[0,1]} 1 1 1 1 1000
[5] {} => {Concealer=[0,1]} 1 1 1 1 1000