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]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.