{"id":13418394,"url":"https://github.com/NicolasHug/Surprise","last_synced_at":"2025-03-15T03:31:04.749Z","repository":{"id":37545459,"uuid":"71709976","full_name":"NicolasHug/Surprise","owner":"NicolasHug","description":"A Python scikit for building and analyzing recommender systems","archived":false,"fork":false,"pushed_at":"2024-06-16T11:25:37.000Z","size":6977,"stargazers_count":6373,"open_issues_count":87,"forks_count":1012,"subscribers_count":145,"default_branch":"master","last_synced_at":"2024-10-14T12:04:38.678Z","etag":null,"topics":["factorization","machine-learning","matrix","recommendation","recommender","svd","systems"],"latest_commit_sha":null,"homepage":"http://surpriselib.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NicolasHug.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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}},"created_at":"2016-10-23T14:59:38.000Z","updated_at":"2024-10-14T09:20:07.000Z","dependencies_parsed_at":"2024-06-16T12:36:22.381Z","dependency_job_id":null,"html_url":"https://github.com/NicolasHug/Surprise","commit_stats":{"total_commits":613,"total_committers":46,"mean_commits":"13.326086956521738","dds":"0.45187601957585644","last_synced_commit":"687ed960ef8dac599b3c49f1cf7d6ad1e5bad1f4"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicolasHug%2FSurprise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicolasHug%2FSurprise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicolasHug%2FSurprise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicolasHug%2FSurprise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NicolasHug","download_url":"https://codeload.github.com/NicolasHug/Surprise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243681024,"owners_count":20330152,"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":["factorization","machine-learning","matrix","recommendation","recommender","svd","systems"],"created_at":"2024-07-30T22:01:01.778Z","updated_at":"2025-03-15T03:31:04.025Z","avatar_url":"https://github.com/NicolasHug.png","language":"Python","readme":"[![GitHub version](https://badge.fury.io/gh/nicolashug%2FSurprise.svg)](https://badge.fury.io/gh/nicolashug%2FSurprise)\n[![Documentation Status](https://readthedocs.org/projects/surprise/badge/?version=stable)](https://surprise.readthedocs.io/en/stable/?badge=stable)\n[![python versions](https://img.shields.io/badge/python-3.8+-blue.svg)](https://surpriselib.com)\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n[![DOI](https://joss.theoj.org/papers/10.21105/joss.02174/status.svg)](https://doi.org/10.21105/joss.02174)\n\n[![logo](./logo_black.svg)](https://surpriselib.com)\n\nOverview\n--------\n\n[Surprise](https://surpriselib.com) is a Python\n[scikit](https://projects.scipy.org/scikits.html) for building and analyzing\nrecommender systems that deal with explicit rating data.\n\n[Surprise](https://surpriselib.com) **was designed with the\nfollowing purposes in mind**:\n\n- Give users perfect control over their experiments. To this end, a strong\n  emphasis is laid on\n  [documentation](https://surprise.readthedocs.io/en/stable/index.html), which we\n  have tried to make as clear and precise as possible by pointing out every\n  detail of the algorithms.\n- Alleviate the pain of [Dataset\n  handling](https://surprise.readthedocs.io/en/stable/getting_started.html#load-a-custom-dataset).\n  Users can use both *built-in* datasets\n  ([Movielens](https://grouplens.org/datasets/movielens/),\n  [Jester](https://eigentaste.berkeley.edu/dataset/)), and their own *custom*\n  datasets.\n- Provide various ready-to-use [prediction\n  algorithms](https://surprise.readthedocs.io/en/stable/prediction_algorithms_package.html)\n  such as [baseline\n  algorithms](https://surprise.readthedocs.io/en/stable/basic_algorithms.html),\n  [neighborhood\n  methods](https://surprise.readthedocs.io/en/stable/knn_inspired.html), matrix\n  factorization-based (\n  [SVD](https://surprise.readthedocs.io/en/stable/matrix_factorization.html#surprise.prediction_algorithms.matrix_factorization.SVD),\n  [PMF](https://surprise.readthedocs.io/en/stable/matrix_factorization.html#unbiased-note),\n  [SVD++](https://surprise.readthedocs.io/en/stable/matrix_factorization.html#surprise.prediction_algorithms.matrix_factorization.SVDpp),\n  [NMF](https://surprise.readthedocs.io/en/stable/matrix_factorization.html#surprise.prediction_algorithms.matrix_factorization.NMF)),\n  and [many\n  others](https://surprise.readthedocs.io/en/stable/prediction_algorithms_package.html).\n  Also, various [similarity\n  measures](https://surprise.readthedocs.io/en/stable/similarities.html)\n  (cosine, MSD, pearson...) are built-in.\n- Make it easy to implement [new algorithm\n  ideas](https://surprise.readthedocs.io/en/stable/building_custom_algo.html).\n- Provide tools to [evaluate](https://surprise.readthedocs.io/en/stable/model_selection.html),\n  [analyse](https://nbviewer.jupyter.org/github/NicolasHug/Surprise/tree/master/examples/notebooks/KNNBasic_analysis.ipynb/)\n  and\n  [compare](https://nbviewer.jupyter.org/github/NicolasHug/Surprise/blob/master/examples/notebooks/Compare.ipynb)\n  the algorithms' performance. Cross-validation procedures can be run very\n  easily using powerful CV iterators (inspired by\n  [scikit-learn](https://scikit-learn.org/) excellent tools), as well as\n  [exhaustive search over a set of\n  parameters](https://surprise.readthedocs.io/en/stable/getting_started.html#tune-algorithm-parameters-with-gridsearchcv).\n\n\nThe name *SurPRISE* (roughly :) ) stands for *Simple Python RecommendatIon\nSystem Engine*.\n\nPlease note that surprise does not support implicit ratings or content-based\ninformation.\n\n\nGetting started, example\n------------------------\n\nHere is a simple example showing how you can (down)load a dataset, split it for\n5-fold cross-validation, and compute the MAE and RMSE of the\n[SVD](https://surprise.readthedocs.io/en/stable/matrix_factorization.html#surprise.prediction_algorithms.matrix_factorization.SVD)\nalgorithm.\n\n\n```python\nfrom surprise import SVD\nfrom surprise import Dataset\nfrom surprise.model_selection import cross_validate\n\n# Load the movielens-100k dataset (download it if needed).\ndata = Dataset.load_builtin('ml-100k')\n\n# Use the famous SVD algorithm.\nalgo = SVD()\n\n# Run 5-fold cross-validation and print results.\ncross_validate(algo, data, measures=['RMSE', 'MAE'], cv=5, verbose=True)\n```\n\n**Output**:\n\n```\nEvaluating RMSE, MAE of algorithm SVD on 5 split(s).\n\n                  Fold 1  Fold 2  Fold 3  Fold 4  Fold 5  Mean    Std     \nRMSE (testset)    0.9367  0.9355  0.9378  0.9377  0.9300  0.9355  0.0029  \nMAE (testset)     0.7387  0.7371  0.7393  0.7397  0.7325  0.7375  0.0026  \nFit time          0.62    0.63    0.63    0.65    0.63    0.63    0.01    \nTest time         0.11    0.11    0.14    0.14    0.14    0.13    0.02    \n```\n\n[Surprise](https://surpriselib.com) can do **much** more (e.g,\n[GridSearchCV](https://surprise.readthedocs.io/en/stable/getting_started.html#tune-algorithm-parameters-with-gridsearchcv))!\nYou'll find [more usage\nexamples](https://surprise.readthedocs.io/en/stable/getting_started.html) in the\n[documentation ](https://surprise.readthedocs.io/en/stable/index.html).\n\n\nBenchmarks\n----------\n\nHere are the average RMSE, MAE and total execution time of various algorithms\n(with their default parameters) on a 5-fold cross-validation procedure. The\ndatasets are the [Movielens](https://grouplens.org/datasets/movielens/) 100k and\n1M datasets. The folds are the same for all the algorithms. All experiments are\nrun on a laptop with an intel i5 11th Gen 2.60GHz. The code\nfor generating these tables can be found in the [benchmark\nexample](https://github.com/NicolasHug/Surprise/tree/master/examples/benchmark.py).\n\n| [Movielens 100k](http://grouplens.org/datasets/movielens/100k)                                                                         |   RMSE |   MAE | Time    |\n|:---------------------------------------------------------------------------------------------------------------------------------------|-------:|------:|:--------|\n| [SVD](http://surprise.readthedocs.io/en/stable/matrix_factorization.html#surprise.prediction_algorithms.matrix_factorization.SVD)      |  0.934 | 0.737 | 0:00:06 |\n| [SVD++ (cache_ratings=False)](http://surprise.readthedocs.io/en/stable/matrix_factorization.html#surprise.prediction_algorithms.matrix_factorization.SVDpp)  |  0.919 | 0.721 | 0:01:39 |\n| [SVD++ (cache_ratings=True)](http://surprise.readthedocs.io/en/stable/matrix_factorization.html#surprise.prediction_algorithms.matrix_factorization.SVDpp)  |  0.919 | 0.721 | 0:01:22 |\n| [NMF](http://surprise.readthedocs.io/en/stable/matrix_factorization.html#surprise.prediction_algorithms.matrix_factorization.NMF)      |  0.963 | 0.758 | 0:00:06 |\n| [Slope One](http://surprise.readthedocs.io/en/stable/slope_one.html#surprise.prediction_algorithms.slope_one.SlopeOne)                 |  0.946 | 0.743 | 0:00:09 |\n| [k-NN](http://surprise.readthedocs.io/en/stable/knn_inspired.html#surprise.prediction_algorithms.knns.KNNBasic)                        |  0.98  | 0.774 | 0:00:08 |\n| [Centered k-NN](http://surprise.readthedocs.io/en/stable/knn_inspired.html#surprise.prediction_algorithms.knns.KNNWithMeans)           |  0.951 | 0.749 | 0:00:09 |\n| [k-NN Baseline](http://surprise.readthedocs.io/en/stable/knn_inspired.html#surprise.prediction_algorithms.knns.KNNBaseline)            |  0.931 | 0.733 | 0:00:13 |\n| [Co-Clustering](http://surprise.readthedocs.io/en/stable/co_clustering.html#surprise.prediction_algorithms.co_clustering.CoClustering) |  0.963 | 0.753 | 0:00:06 |\n| [Baseline](http://surprise.readthedocs.io/en/stable/basic_algorithms.html#surprise.prediction_algorithms.baseline_only.BaselineOnly)   |  0.944 | 0.748 | 0:00:02 |\n| [Random](http://surprise.readthedocs.io/en/stable/basic_algorithms.html#surprise.prediction_algorithms.random_pred.NormalPredictor)    |  1.518 | 1.219 | 0:00:01 |\n\n\n| [Movielens 1M](https://grouplens.org/datasets/movielens/1m)                                                                             |   RMSE |   MAE | Time    |\n|:----------------------------------------------------------------------------------------------------------------------------------------|-------:|------:|:--------|\n| [SVD](https://surprise.readthedocs.io/en/stable/matrix_factorization.html#surprise.prediction_algorithms.matrix_factorization.SVD)      |  0.873 | 0.686 | 0:01:07 |\n| [SVD++ (cache_ratings=False)](https://surprise.readthedocs.io/en/stable/matrix_factorization.html#surprise.prediction_algorithms.matrix_factorization.SVDpp)  |  0.862 | 0.672 | 0:41:06 |\n| [SVD++ (cache_ratings=True)](https://surprise.readthedocs.io/en/stable/matrix_factorization.html#surprise.prediction_algorithms.matrix_factorization.SVDpp)  |  0.862 | 0.672 | 0:34:55 |\n| [NMF](https://surprise.readthedocs.io/en/stable/matrix_factorization.html#surprise.prediction_algorithms.matrix_factorization.NMF)      |  0.916 | 0.723 | 0:01:39 |\n| [Slope One](http://surprise.readthedocs.io/en/stable/slope_one.html#surprise.prediction_algorithms.slope_one.SlopeOne)                 |  0.907 | 0.715 | 0:02:31 |\n| [k-NN](http://surprise.readthedocs.io/en/stable/knn_inspired.html#surprise.prediction_algorithms.knns.KNNBasic)                        |  0.923 | 0.727 | 0:05:27 |\n| [Centered k-NN](http://surprise.readthedocs.io/en/stable/knn_inspired.html#surprise.prediction_algorithms.knns.KNNWithMeans)           |  0.929 | 0.738 | 0:05:43 |\n| [k-NN Baseline](http://surprise.readthedocs.io/en/stable/knn_inspired.html#surprise.prediction_algorithms.knns.KNNBaseline)            |  0.895 | 0.706 | 0:05:55 |\n| [Co-Clustering](http://surprise.readthedocs.io/en/stable/co_clustering.html#surprise.prediction_algorithms.co_clustering.CoClustering) |  0.915 | 0.717 | 0:00:31 |\n| [Baseline](http://surprise.readthedocs.io/en/stable/basic_algorithms.html#surprise.prediction_algorithms.baseline_only.BaselineOnly)   |  0.909 | 0.719 | 0:00:19 |\n| [Random](http://surprise.readthedocs.io/en/stable/basic_algorithms.html#surprise.prediction_algorithms.random_pred.NormalPredictor)    |  1.504 | 1.206 | 0:00:19 |\n\nInstallation\n------------\n\nWith pip (you'll need a C compiler. Windows users might prefer using conda):\n\n    $ pip install scikit-surprise\n\nWith conda:\n\n    $ conda install -c conda-forge scikit-surprise\n\nFor the latest version, you can also clone the repo and build the source\n(you'll first need [Cython](https://cython.org/) and\n[numpy](https://www.numpy.org/)):\n\n    $ git clone https://github.com/NicolasHug/surprise.git\n    $ cd surprise\n    $ pip install .\n\nLicense and reference\n---------------------\n\nThis project is licensed under the [BSD\n3-Clause](https://opensource.org/licenses/BSD-3-Clause) license, so it can be\nused for pretty much everything, including commercial applications.\n\nI'd love to know how Surprise is useful to you. Please don't hesitate to open\nan issue and describe how you use it!\n\nPlease make sure to cite the\n[paper](https://joss.theoj.org/papers/10.21105/joss.02174) if you use\nSurprise for your research:\n\n    @article{Hug2020,\n      doi = {10.21105/joss.02174},\n      url = {https://doi.org/10.21105/joss.02174},\n      year = {2020},\n      publisher = {The Open Journal},\n      volume = {5},\n      number = {52},\n      pages = {2174},\n      author = {Nicolas Hug},\n      title = {Surprise: A Python library for recommender systems},\n      journal = {Journal of Open Source Software}\n    }\n\nContributors\n------------\n\nThe following persons have contributed to [Surprise](https://surpriselib.com):\n\nashtou, Abhishek Bhatia, bobbyinfj, caoyi, Chieh-Han Chen,  Raphael-Dayan, Олег\nДемиденко, Charles-Emmanuel Dias, dmamylin, Lauriane Ducasse, Marc Feger,\nfranckjay, Lukas Galke, Tim Gates, Pierre-François Gimenez, Zachary Glassman,\nJeff Hale, Nicolas Hug, Janniks, jyesawtellrickson, Doruk Kilitcioglu, Ravi Raju\nKrishna, lapidshay, Hengji Liu, Ravi Makhija, Maher Malaeb, Manoj K, James\nMcNeilis, Naturale0, nju-luke, Pierre-Louis Pécheux, Jay Qi, Lucas Rebscher,\nCraig Rodrigues, Skywhat, Hercules Smith, David Stevens, Vesna Tanko,\nTrWestdoor, Victor Wang, Mike Lee Williams, Jay Wong, Chenchen Xu, YaoZh1918.\n\nThanks a lot :) !\n\nDevelopment Status\n------------------\n\nStarting from version 1.1.0 (September 2019), I will only maintain the package,\nprovide bugfixes, and perhaps sometimes perf improvements. I have less time to\ndedicate to it now, so I'm unabe to consider new features.\n\nFor bugs, issues or questions about [Surprise](https://surpriselib.com), please\navoid sending me emails; I will most likely not be able to answer). Please use\nthe GitHub [project page](https://github.com/NicolasHug/Surprise) instead, so\nthat others can also benefit from it.\n","funding_links":[],"categories":["Recommender systems","Python","资源列表","Uncategorized","Recommender Systems","Learning-to-Rank \u0026 Recommender Systems","Recommendation Systems","Recommendation, Advertisement \u0026 Ranking","推荐系统","推荐系统算法库与列表","machine-learning","5. GitHub Repositories","Recommender Systems [🔝](#readme)","Feature Extraction"],"sub_categories":["推荐系统","Uncategorized","Others","网络服务_其他","Ranking/Recommender"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNicolasHug%2FSurprise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNicolasHug%2FSurprise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNicolasHug%2FSurprise/lists"}