I have a question regarding apriori rule deployment in R. I basically want to assign a predcition(item) and a confidence value to each customer so I can create a simple recommending system, so below is a subset of my rule set which I have obtained,
bread&wine -> meat (confidence 54%)
cheese -> fruit (confidence 43%)
bread&cheese -> frozveg (confidence 24%)
and the following is simple representation of what I want to achieve with just 1 customer; this is in a basket or truth-table data.
ID|Bread|Wine| Cheese Pred1 Conf1 Pred2 Conf2
1 | 1 | 1 | 1 meat| 0.54| fruit| 0.43
This can be done by simply connecting the dataset to the model nugget in IBM SPSS Modeler, but it does not seem easy in R.
Can anyone provide me with a solution in R code on this or a simple guide in doing this?
Package recommenderlab does what you want (minus showing the confidence). Here is some code (adapted from the documentation of recommenerlab) which learns a recommender model from the Groceries data set and applies it to the first 10 transactions:
Here are the parameters you can use when you create the recommender.