{"id":14067990,"url":"https://github.com/mhahsler/recommenderlab","last_synced_at":"2025-05-15T07:04:56.159Z","repository":{"id":47444944,"uuid":"58234042","full_name":"mhahsler/recommenderlab","owner":"mhahsler","description":"recommenderlab - Lab for Developing and Testing Recommender Algorithms - R package","archived":false,"fork":false,"pushed_at":"2025-03-26T03:25:38.000Z","size":88148,"stargazers_count":215,"open_issues_count":8,"forks_count":61,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-11T15:57:14.824Z","etag":null,"topics":["collaborative-filtering","recommender-system"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhahsler.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-05-06T20:47:55.000Z","updated_at":"2025-04-01T11:43:13.000Z","dependencies_parsed_at":"2023-01-29T01:15:13.915Z","dependency_job_id":"3b1a04e2-7493-4875-804a-30b208b686c3","html_url":"https://github.com/mhahsler/recommenderlab","commit_stats":{"total_commits":175,"total_committers":10,"mean_commits":17.5,"dds":"0.11428571428571432","last_synced_commit":"ae9d03465fc30f49d9096d49696737f70ab2d404"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhahsler%2Frecommenderlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhahsler%2Frecommenderlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhahsler%2Frecommenderlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhahsler%2Frecommenderlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhahsler","download_url":"https://codeload.github.com/mhahsler/recommenderlab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253605069,"owners_count":21934928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collaborative-filtering","recommender-system"],"created_at":"2024-08-13T07:05:53.149Z","updated_at":"2025-05-15T07:04:51.129Z","avatar_url":"https://github.com/mhahsler.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n```{r echo=FALSE, results = 'asis'}\npkg \u003c- 'recommenderlab'\n\nsource(\"https://raw.githubusercontent.com/mhahsler/pkg_helpers/main/pkg_helpers.R\")\npkg_title(pkg)\n```\n\n## Introduction\n\nProvides a research infrastructure to develop and evaluate collaborative filtering recommender algorithms. This includes a sparse representation for user-item matrices, many popular algorithms, top-N recommendations, and cross-validation. \nThe package supports rating (e.g., 1-5 stars) and unary (0-1) data sets. \n\n```{r echo=FALSE, results = 'asis'}\npkg_usage(pkg)\npkg_citation(pkg, 2)\n```\n\n## Supported algorithms\n\n### Recommender algorithm     \n* User-based collaborative filtering (**UBCF**)\n* Item-based collaborative filtering (**IBCF**)\n* SVD with column-mean imputation (**SVD**)\n* Funk SVD (**SVDF**)\n* Alternating Least Squares (**ALS**)\n* Matrix factorization with LIBMF (**LIBMF**)\n* Association rule-based recommender (**AR**)\n* Popular items (**POPULAR**)\n* Randomly chosen items for comparison (**RANDOM**)\n* Re-recommend liked items (**RERECOMMEND**)\n* Hybrid recommendations (**HybridRecommender**)\n\n\n### Recommender Evaluation\n\nThe framework supports given-n and all-but-x protocols with\n\n* Train/test split\n* Cross-validation\n* Repeated bootstrap sampling\n\nAvailable evaluation measures are\n\n* Rating errors: MSE, RMSE, MAE\n* Top-N recommendations: TPR/FPR (ROC), precision and recall\n\n```{r echo=FALSE, results = 'asis'}\npkg_install(pkg)\n```\n\n## Usage\n\nLoad the package and prepare a dataset (included in the package). The MovieLense\ndata contains user ratings for movies on a 1 to 5 star scale.\nWe only use here users with more than 100 ratings.\n```{r}\nset.seed(1234)\n\nlibrary(\"recommenderlab\")\ndata(\"MovieLense\")\n\nMovieLense100 \u003c- MovieLense[rowCounts(MovieLense) \u003e 100, ]\nMovieLense100\n```\n\nTrain a user-based collaborative filtering recommender using a small training set.\n```{r}\ntrain \u003c- MovieLense100[1:300]\nrec \u003c- Recommender(train, method = \"UBCF\")\nrec\n```\n\nCreate top-N recommendations for new users (users 301 and 302).\n```{r}\npre \u003c- predict(rec, MovieLense100[301:302], n = 5)\npre\n```\n\n```{r}\nas(pre, \"list\")\n```\n\nUse a 10-fold cross-validation scheme to compare the top-N lists of several algorithms.\nMovies with 4 or more stars are considered a good recommendation. \nWe plot true negative vs. true positive rate for top-N lists of different lengths.\n```{r TNR_vs_TPR}\nscheme \u003c- evaluationScheme(MovieLense100, method = \"cross-validation\", k = 10, \n  given = -5, goodRating = 4)\nscheme\n\nalgorithms \u003c- list(\n  \"random items\" = list(name = \"RANDOM\", param = NULL),\n  \"popular items\" = list(name = \"POPULAR\", param = NULL),\n  \"user-based CF\" = list(name = \"UBCF\", param = list(nn = 3)),\n  \"item-based CF\" = list(name = \"IBCF\", param = list(k = 100))\n)\n\nresults \u003c- evaluate(scheme, algorithms, type = \"topNList\",\n  n=c(1, 3, 5, 10), progress = FALSE)\n\nplot(results, annotate = 2, legend = \"topleft\")\n```\n\n## Shiny App\n\nA simple Shiny App running recommenderlab can be found at  [https://mhahsler-apps.shinyapps.io/Jester/](https://mhahsler-apps.shinyapps.io/Jester/) \n([source code](https://github.com/mhahsler/recommenderlab/tree/master/Work/apps)). \n\n\n## References\n\n* Michael Hahsler (2022) recommenderlab: An R framework for developing and testing recommendation algorithms. arXiv:2205.12371 [cs.IR]. DOI: [10.48550/arXiv.2205.12371](https://doi.org/10.48550/arXiv.2205.12371).\n* recommenderlab [reference manual](https://CRAN.R-project.org/package=recommenderlab/recommenderlab.pdf)\n*  Suresh K. Gorakala and Michele Usuelli (2015) [Building a Recommendation System with R](https://www.amazon.com/Building-Recommendation-System-Suresh-Gorakala/dp/1783554495) (Packt Publishing) features the package recommenderlab.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhahsler%2Frecommenderlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhahsler%2Frecommenderlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhahsler%2Frecommenderlab/lists"}