Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create an Item Frequency Plot for association rule data? By converting to data frame or numeric?

Tags:

r

csv

I have given the code that the rules are generated.I would like to create an item frequency histogram plot but ıt didn't work.

library(arules)
library(arulesViz)
library(rattle)

x <- read.table("C:/Users/toshıba pc/Desktop/Kitap2.csv", header = TRUE, sep = ";")
y <- as.matrix(x)

rules <- apriori(y, parameter = list(supp = 0.1, conf = 0.8))

itemFrequencyPlot(rules, support = 0.1, cex.names = 0.8)

Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘itemFrequencyPlot’ for signature ‘"rules"’

like image 505
Annabella Avatar asked Oct 23 '25 02:10

Annabella


1 Answers

itemFrequencyPlot is not defined for rules. You can use

itemFrequencyPlot(items(rules))

to get the frequency of the items in the rules, but I am not sure that this will give you the results you want.

like image 172
Michael Hahsler Avatar answered Oct 24 '25 17:10

Michael Hahsler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!