0 votes

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")


 

by

1 Answer

0 votes

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

by
Hello Thomas,


I decreased the degree of confidence. It works perfectly. I'll look a little more deeply how this algorythm work .

thanks again
Merci beaucoup :)
1,298 questions
1,326 answers
1,507 comments
11,863 users

┬ęDataiku 2012-2018 - Privacy Policy