ankur verma
2012-Jun-25 12:38 UTC
[R] Arules - predict function issues - subscript out of bounds
Hi, I'm doing a Market Basket Analysis in which I have a list of transaction id's in column 2 and transactions(product names) in column 1. I read this into a transaction file using a txn<-read.transaction(file="data.csv",format='single', rm.duplicates=F, cols=c(1,2)) If I want to use the apriori algorithm everything seems to be running fine. However it is when I want to form cluster of these transactional patterns I find problems. I formed clusters using the following code: s<-sample(txn,1000) d<-dissimilarity(s, method="Jaccard") clustering<-pam(d,k=5) But when I'm trying to predict this on the larger set it keeps throwing an subscript out of bound error Label<-predict(s[clustering$mediods],txn,method="Jaccard") Can anyone explain to me why this keeps happening ?? I've tried this on other datasets like Groceries/ Adult in the arules package and it seems to work fine !! Thanks, Ankur [[alternative HTML version deleted]]
alicechao
2012-Sep-28 18:24 UTC
[R] Arules - predict function issues - subscript out of bounds
Hi Ankur, I am running into the exact same issue you have described above. Were you able to find out why it didn't work on your data set and resolve it? If yes, could you share? Much thanks & regards, Alice -- View this message in context: http://r.789695.n4.nabble.com/Arules-predict-function-issues-subscript-out-of-bounds-tp4634422p4644546.html Sent from the R help mailing list archive at Nabble.com.