arules

Capture the output of arules::inspect as data.frame

走远了吗. 提交于 2021-01-29 10:38:36
问题 In "Zero frequent items" when using the eclat to mine frequent itemsets, the OP is interested in the groupings/clusterings based on how frequent they are ordered together. This grouping can be inspected by the arules::inspect function. library(arules) dataset <- read.transactions("8GbjnHK2.txt", sep = ";", rm.duplicates = TRUE) f <- eclat(dataset, parameter = list( supp = 0.001, maxlen = 17, tidLists = TRUE)) inspect(head(sort(f, by = "support"), 10)) The data set can be downloaded from https

Plotting interactive arulesViz plots in shiny R

主宰稳场 提交于 2020-07-11 04:44:53
问题 i need to display interactive association rules plot in shiny. For that i am using arulesViz package. But when i am trying to display interactive scatter plot using the below: shinyServer(function(input, output) { output$plot1<-renderPlot({ rules <- apriori(transaction_all[[as.numeric(input$level)]],parameter=list(support=input$support,confidence=input$confidence)) plot(rules, measure=c("support", "lift"), shading="confidence",interactive = TRUE) }) Its throwing an error: Error in convertUnit

Plotting interactive arulesViz plots in shiny R

為{幸葍}努か 提交于 2020-07-11 04:43:58
问题 i need to display interactive association rules plot in shiny. For that i am using arulesViz package. But when i am trying to display interactive scatter plot using the below: shinyServer(function(input, output) { output$plot1<-renderPlot({ rules <- apriori(transaction_all[[as.numeric(input$level)]],parameter=list(support=input$support,confidence=input$confidence)) plot(rules, measure=c("support", "lift"), shading="confidence",interactive = TRUE) }) Its throwing an error: Error in convertUnit

The inspect function not found

淺唱寂寞╮ 提交于 2020-05-24 05:30:13
问题 Coursetopics <-read.csv("Coursetopics.csv") #remove first column Coursetopics.mat <-as.matrix(Coursetopics[,-1]) #convert the binary incidence matrix into a transaction database Coursetopics.trans<-as(Coursetopics.mat, "transactions") inspect(Coursetopics.trans) This is the code. My issue is getting the inspect function to work properly Error reads as follows: Error in inspect(Coursetopics.trans) : could not find function "inspect" I have added arules and tm packages but no luck on getting

How to convert object of Transaction to Dataframe in R

99封情书 提交于 2020-02-28 18:45:26
问题 How to convert the Dataset(Groceries) in arules package to dataframe. class(Groceries) [1] "transactions" attr(,"package") [1] "arules" 回答1: You need to specify what is actually needed. I don't see an as.data.frame.transactions function in the help page for the arules -package. The data-item Groceries does have a dataframe embedded in it but whether that is what you want seems unlikely: str(Groceries) Formal class 'transactions' [package "arules"] with 3 slots ..@ data :Formal class

cSPADE data mining in R using arulesSequences - Error while converting to “transactions” format

雨燕双飞 提交于 2020-01-03 04:07:09
问题 I'm having trouble converting my data into cSPADE compatible format. My data frame looks like- key type1 type2 type3 A-1 A B C B-2 P Q NA C-3 X NA NA When I use, dataset1<- as(dataset, "transactions") and run- rules<- cspade(dataset1, parameter = list(support = 0.4), control = list(verbose = TRUE)) It throws an error - Error in cspade(dataset1, parameter = list(support = 0.4), control = list(verbose = TRUE)) : slot transactionInfo: missing 'sequenceID' or 'eventID' Can anyone please help as

R Basket Analysis using arules package with unique order number but duplicate order combinations

。_饼干妹妹 提交于 2019-12-31 16:49:35
问题 R Basket analysis using arules package with unique order number but duplicate order combinations Just learning R. I'm trying to do a basket analysis using the arules package (but I'm totally open to any other package suggestions!) to compare all possible combinations of 6 different item types being purchased. My original data set looked like this: OrderNo, ItemType, ItemCount 111, Health, 1 111, Leisure, 2 111, Sports, 1 222, Health, 3 333, Food, 7 333, Clothing, 1 444, Clothing, 2 444,

R Basket Analysis using arules package with unique order number but duplicate order combinations

你说的曾经没有我的故事 提交于 2019-12-31 16:47:53
问题 R Basket analysis using arules package with unique order number but duplicate order combinations Just learning R. I'm trying to do a basket analysis using the arules package (but I'm totally open to any other package suggestions!) to compare all possible combinations of 6 different item types being purchased. My original data set looked like this: OrderNo, ItemType, ItemCount 111, Health, 1 111, Leisure, 2 111, Sports, 1 222, Health, 3 333, Food, 7 333, Clothing, 1 444, Clothing, 2 444,

Association rule in R - removing redundant rule (arules)

馋奶兔 提交于 2019-12-30 03:36:13
问题 Assume we have 3 rules: [1] {A,B,D} -> {C} [2] {A,B} -> {C} [3] Whatever it is Rule [2] is a subset of rule [1] (because rule [1] contains all the items in rule [2] ), so rule [1] should be eliminated (because rule [1] is too specific and its information is included in rule [2] ) I searched through the internet and everyone is using these code to remove redundant rules: subset.matrix <- is.subset(rules.sorted, rules.sorted) subset.matrix[lower.tri(subset.matrix, diag=T)] <- NA redundant <-

R: arulesviz and igraph causing a conflict

亡梦爱人 提交于 2019-12-25 08:58:30
问题 I am trying to visualise the "groceries" dataset. library(arules) library(arulesViz) library(datasets) rules <- apriori(Groceries, parameter = list(supp = 0.001, conf = 0.75)) rules<-sort(rules, decreasing=TRUE,by="confidence") plot(rules, method="graph", interactive = TRUE, shading = NA) On running this, I get an error about the igraph package. Error in igraph::tkplot(g, ..., layout = igraph::layout_(g, control$layout), : tcl/tk library not available What could be the reason for this error?