Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on April 27, 2016 6:54AM
Likes: 0
Replies: 2
Hello
I have a little problem to solve. I 'm not used to with programing with R in the Dataiku environment. I have this error message when I run my code. I tried numerous combination but nothing to do at the moment :
[2016/04/26-21:46:06.171] [Exec-29] [INFO] [dku.utils] - > #dkuWriteDataset(transactions, "rules", partition="produitsgood")
[2016/04/26-21:46:06.174] [Exec-30] [INFO] [dku.utils] - Error in `[.data.frame`(df, i) : undefined columns selected
Thx a lot
_____this is my actual code
install.packages("arules",repos="http://cran.rstudio.com/")
library(dataiku)
library(arules)
# Input datasets
transactions <- dkuReadDataset("produits")
# Transform data to make it suitable
transactions <- as(
split(as.vector(transactions$CodeProduit), as.vector(transactions$NumCli)),
"transactions"
)
# Analyze
rules <- apriori(
transactions,
parameter=list(supp=0.02, conf=0.8, target="rules", minlen=2, maxlen=2)
)
rules <- sort(rules, by ="lift")
# Output datasets
dkuWriteDataset(as(rules, "data.frame"), "produitsgood")
Hi Loman,
It looks like you may have 0 record in your "rules" dataset, meaning that the levels of support and confidence are too high to find rules. Try decreasing the values in:
parameter=list(supp=0.02, conf=0.8, target="rules", minlen=2, maxlen=2)
and this may work.
Thanks