ludovikcoba / rrecsys

rrecsys: Environment for Assessing Recommender Systems
https://cran.r-project.org/package=rrecsys
23 stars 11 forks source link

Q: How to test the recommand system result correct rate? #8

Closed evenbily closed 6 years ago

evenbily commented 6 years ago

If I have a training set x , and a test set y ,than I execute R command like this: x = defineData(trainingset,sparseMatrix = TRUE) y = defineData(testset,sparseMatrix =TRUE) r <- rrecsys(test, alg = "UBKNN", simFunct = "cos") //use UBKNN algorithm

then how can I compare "r" with "y" ?
I can't find any function for this type of compare , and the evalXXXX function does NOT have another input for this situation .

ludovikcoba commented 6 years ago

rrecsys method is used to train an algorithm on your data. Usually you want to train the train set and evaluate it with your "ground truth" data, i.e a test set. I just pushed a new branch (rrecsys-split, use it in developer mode), that would work on evaluating a specific train set with another specific test set. use as follows:

train <- defineData(train_set, intScale = F)

r <- rrecsys(train, "ub", neigh = 10, simFunct = "Pearson", coRatedThreshold = 2)

rec <- recommendHPR(r, train,topN = 3)

#test set as a data.frame 
e <- evalRec(rec, train, test, positiveThreshold = 3)

At the moment this branch works only with the UB. I am updating the code to work on the algorithms, if you have a preference on a specific algorithm, just comment here so I update it first.

evenbily commented 6 years ago

It's very inspiring . And so grateful for your work . It explains the matter.