Package: scikit-my-surprise
MySurpriseis simply @nicolashug 'sSurprisewith an online version of the SVD algorithm, as well as a few changes to data types to allow for floating-point rankings in some algorithms.
This separate distribution is just to ease our interface withPennAI.
You probably want to just use Surprise.OverviewSurpriseis a Pythonscikitfor building and analyzing
recommender systems that deal with explicit rating data.Surprisewas designed with the
following purposes in mind:Give users perfect control over their experiments. To this end, a strong
emphasis is laid ondocumentation, which we
have tried to make as clear and precise as possible by pointing out every
detail of the algorithms.Alleviate the pain ofDataset
handling.
Users can use bothbuilt-indatasets
(Movielens,Jester), and their owncustomdatasets.Provide various ready-to-useprediction
algorithmssuch asbaseline
algorithms,neighborhood
methods, matrix
factorization-based (SVD,PMF,SVD++,NMF),
andmany
others.
Also, varioussimilarity
measures(cosine, MSD, pearson...) are built-in.Make it easy to implementnew algorithm
ideas.Provide tools toevaluate,analyseandcomparethe algorithms' performance. Cross-validation procedures can be run very
easily using powerful CV iterators (inspired byscikit-learnexcellent tools), as well asexhaustive search over a set of
parameters.The nameSurPRISE(roughly :) ) stands forSimple Python RecommendatIon
System Engine.Please note that surprise does not support implicit ratings or content-based
information.Getting started, exampleHere is a simple example showing how you can (down)load a dataset, split it for
5-fold cross-validation, and compute the MAE and RMSE of theSVDalgorithm.fromsurpriseimportSVDfromsurpriseimportDatasetfromsurprise.model_selectionimportcross_validate# Load the movielens-100k dataset (download it if needed).data=Dataset.load_builtin('ml-100k')# Use the famous SVD algorithm.algo=SVD()# Run 5-fold cross-validation and print results.cross_validate(algo,data,measures=['RMSE','MAE'],cv=5,verbose=True)Output:Evaluating RMSE, MAE of algorithm SVD on 5 split(s).

            Fold 1  Fold 2  Fold 3  Fold 4  Fold 5  Mean    Std
RMSE        0.9311  0.9370  0.9320  0.9317  0.9391  0.9342  0.0032
MAE         0.7350  0.7375  0.7341  0.7342  0.7375  0.7357  0.0015
Fit time    6.53    7.11    7.23    7.15    3.99    6.40    1.23
Test time   0.26    0.26    0.25    0.15    0.13    0.21    0.06Surprisecan domuchmore (e.g,GridSearchCV)!
You'll findmore usage
examplesin thedocumentation.BenchmarksHere are the average RMSE, MAE and total execution time of various algorithms
(with their default parameters) on a 5-fold cross-validation procedure. The
datasets are theMovielens100k and
1M datasets. The folds are the same for all the algorithms. All experiments are
run on a notebook with Intel Core i5 7th gen (2.5 GHz) and 8Go RAM.  The code
for generating these tables can be found in thebenchmark
example.Movielens 100kRMSEMAETimeSVD0.9340.7370:00:11SVD++0.920.7220:09:03NMF0.9630.7580:00:15Slope One0.9460.7430:00:08k-NN0.980.7740:00:10Centered k-NN0.9510.7490:00:10k-NN Baseline0.9310.7330:00:12Co-Clustering0.9630.7530:00:03Baseline0.9440.7480:00:01Random1.5141.2150:00:01Movielens 1MRMSEMAETimeSVD0.8730.6860:02:13SVD++0.8620.6732:54:19NMF0.9160.7240:02:31Slope One0.9070.7150:02:31k-NN0.9230.7270:05:27Centered k-NN0.9290.7380:05:43k-NN Baseline0.8950.7060:05:55Co-Clustering0.9150.7170:00:31Baseline0.9090.7190:00:19Random1.5041.2060:00:19InstallationWith pip (you'll neednumpy, and a C compiler. Windows
users might prefer using conda):$ pip install numpy
$ pip install scikit-surpriseWith conda:$ conda install -c conda-forge scikit-surpriseFor the latest version, you can also clone the repo and build the source
(you'll first needCythonandnumpy):$ pip install numpy cython
$ git clone https://github.com/NicolasHug/surprise.git
$ cd surprise
$ python setup.py installLicense and referenceThis project is licensed under theBSD
3-Clauselicense, so it can be
used for pretty much everything, including commercial applications. Please let
us know howSurpriseis useful to you!Please make sure to cite thepaperif you use
Surprise for your research:@article{Hug2020,
  doi = {10.21105/joss.02174},
  url = {https://doi.org/10.21105/joss.02174},
  year = {2020},
  publisher = {The Open Journal},
  volume = {5},
  number = {52},
  pages = {2174},
  author = {Nicolas Hug},
  title = {Surprise: A Python library for recommender systems},
  journal = {Journal of Open Source Software}
}ContributorsThe following persons have contributed toSurprise:ashtou, bobbyinfj, caoyi, Олег Демиденко, Charles-Emmanuel Dias, dmamylin,
Lauriane Ducasse, Marc Feger, franckjay, Lukas Galke, Tim Gates,
Pierre-François Gimenez, Zachary Glassman, Jeff Hale, Nicolas Hug, Janniks,
jyesawtellrickson, Doruk Kilitcioglu, Ravi Raju Krishna, Hengji Liu, Maher
Malaeb, Manoj K, James McNeilis, Naturale0, nju-luke, Jay Qi, Lucas Rebscher,
Skywhat, David Stevens, TrWestdoor, Victor Wang, Mike Lee Williams, Jay Wong,
Chenchen Xu, YaoZh1918.Thanks a lot :) !Development StatusStarting from version 1.1.0 (September 19), we will only maintain the
package and provide bugfixes. No new features will be considered.For bugs, issues or questions aboutSurprise,
please use the GitHubproject page.
Please don't send emails (we will not answer).