GithubHelp home page GithubHelp logo

ludovikcoba / rrecsys Goto Github PK

View Code? Open in Web Editor NEW
23.0 4.0 11.0 1.92 MB

rrecsys: Environment for Assessing Recommender Systems

Home Page: https://cran.r-project.org/package=rrecsys

R 71.75% C++ 28.25%

rrecsys's Introduction

** THIS PROJECT IS NOT MAINTAINED ANYMORE **

rrecsys

CRAN CRAN Appveyor build status Travis CI build status

A package for R that provides implementations of several state-of-the-art recommendation systems.

Currently on rrecsys are developed the following non-personalized recommender systems (RS) algorithms:

  • Global Average
  • Item Average
  • User Average
  • Most popular

Collaborative filtering:

  • Item Based K-nearest neighbors
  • Simon Funk's SVD
  • Bayesian Personalized Ranking (BPR)
  • Weighted Alternated Least Squares (wALS)

rrecsys can be used to predict and recommend(top-N list) using any of the above algorithms. Algorithms work on both Likert scale and binary ratings but BPR and wALS are One-Class CF(OCCF) typical algorithms for implicit feedback. The package offers as well an evaluation methodology with the following standard metrics for the specific task:

  • prediction: global or user based MAE and RMSE
  • recommendation: precision, recall, F1, NDCG, rank score and all the elements of the confusion matrix.

Installation & Loading the package

This section is dedicated to the recommender systems community with no experience in R. The package is available on CRAN and as well on GitHub. Both versions are downloadable and installable. To install it from CRAN:

install.packages("rrecsys")

Once the package is installed the usual thing to do would be to load it in the environment:

library(rrecsys)

Usually we try to keep updated both GitHub and CRAN with the same version of the package. The version on GitHub is intended for the developing community and we recommend to use it with RStudio. On another vignette will be given details on how to extend rrecsys.

Research

If you use our package in your research, please cite:

@inproceedings{Coba:2017:VAR:3109859.3109982, author = {\c{C}oba, Ludovik and Symeonidis, Panagiotis and Zanker, Markus}, title = {Visual Analysis of Recommendation Performance}, booktitle = {Proceedings of the Eleventh ACM Conference on Recommender Systems}, series = {RecSys '17}, year = {2017}, isbn = {978-1-4503-4652-8}, location = {Como, Italy}, pages = {362--363}, numpages = {2}, url = {http://doi.acm.org/10.1145/3109859.3109982}, doi = {10.1145/3109859.3109982}, acmid = {3109982}, publisher = {ACM}, address = {New York, NY, USA}, keywords = {evaluation, r, recommendation algorithms, visualization}, }

rrecsys's People

Contributors

andland avatar franckjay avatar ludovikcoba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rrecsys's Issues

recommendMF does not work with UBclass or IBclass

Function recommendMF does not work (while recommendHPR does).
It looks like an error in line to call "UseMethod("recommendMF", model)".

userBasedRec <- rrecsys(ML, "ubknn", simFunct="Pearson")
recommendMF(userBasedRec,topN=3, pt=1)
Error in UseMethod("recommendMF", model) : 
  no applicable method for 'recommendMF' applied to an object of class "c('UBclass', 'SimilBasedClass')"

nDCG per user other than per fold

Another thing is with the returned metric values. To do statistical tests, e.g. t-tests, more samples are needed and by increasing number of folds just to get over 30 samples is simply too time costly. I have tried modifying the evalRec.R file with
# Combine the normal res with the nDCG per folds as a list
res <- list(res, nDCG_folds)
where nDCG_folds contains all the nDCG per users. But I feel like there could be a much more elegant solution where the user can easily access the metric value per user with result. I would be happy to try and help implement something.

Out-of-Sample Prediction

Hi,

is there a possibility to run an out-of-sample prediction in rrecsys?
In the way I understood the package, only previously trained data can be used for prediction. For my purposes, I need to create a model on a training data set and predict values for a test data set.
In other packages this is easily possible but in rrecsys I haven't found a way to do so yet.

bpr keeps on running without getting to a solution

i'm trying to use the bpr algorithm following the example given in the vignette:

data("mlLatest100k")
ML <- defineData(mlLatest100k, minimum = .5, maximum = 5, intScale = TRUE)
subML <- ML[rowRatings(ML)>=40, colRatings(ML)>=30]
bpr <- rrecsys(subML, "BPR", k = 10, randomInit = FALSE, 
               regU = .0025, regI = .0025, regJ = 0.0025, updateJ = TRUE)

Unfortunately, even if i let this running for an hour, i don't reach a solution, it just keeps on running.

I tried adding a stopping criterion and / or setting randomInit to TRUE with no effect:

setStoppingCriteria(nrLoops = 10)

Am i doing something wrong?

could not find function "eval_nDCG"

I am using R package ‘rrecsys’ version 0.9.7.3.1 and yet I cannot use eval_nDCG.
The function is documented in the help reference (?) but I cannot use it.
I get the following error: could not find function "eval_nDCG"
Am I doing something wrong? This is unusual and my first experience of a function documented and yet not available.

Error in V[j, ] <- V[j, ] + lambda * (sigma * (-U[u, ]) - regJ * V[j, : NAs are not allowed in subscripted assignments

I am getting this error

Error in V[j, ] <- V[j, ] + lambda * (sigma * (-U[u, ]) - regJ * V[j, : NAs are not allowed in sub-scripted
assignments

on default settings, although there are no NAs in the dataset. When i set the lambda to 0.001 then I get the following error;

Error in U[u, ] <- U[u, ] + lambda * (sigma * (V[i, ] - V[j, ]) - regU * :
replacement has length zero

AprUsg1.zip

Implement with sparse matrix rather than matrix??

Hey thank you for implementing this recommender system library. I have been using it to deal with some big dataset, e.g. 22531 users and 43968 items. To define the dataSet I just run out of memory since it requires a matrix. Would you be able to change it to a sparse matrix?

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

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 .

NA's returned by recommendHPR

I'm trying to reproduce recommendHPR example:

myratings <- matrix(sample(c(0:5), size = 200, replace = TRUE,  prob = c(.6,.08,.08,.08,.08,.08)), nrow = 20, byrow = TRUE)
myratings <- defineData(myratings)
r <- rrecsys(myratings, alg = "FunkSVD", k = 2)
rec <- recommendHPR(r)

But myratings matrix has 0 as minimun value, so I've included minimum = 0 at defineData function. In this case, recommendHPR returns a list of NA's. Have I done something wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.