基于python的分析系统_Surprise: Surprise是一个基于Python scikit构建和分析推荐系统...

Overview

Surprise is a Python

scikit for building and analyzing

recommender systems that deal with explicit rating data.

Surprise was designed with the

following purposes in mind:

Give users perfect control over their experiments. To this end, a strong

emphasis is laid on

documentation, which we

have tried to make as clear and precise as possible by pointing out every

detail of the algorithms.

Alleviate the pain of Dataset

handling.

Users can use both built-in datasets

(Movielens,

Jester), and their own custom

datasets.

Provide various ready-to-use prediction

algorithms

such as baseline

algorithms,

neighborhood

methods, matrix

factorization-based (

SVD,

PMF,

SVD++,

NMF),

and many

others.

Also, various similarity

measures

(cosine, MSD, pearson...) are built-in.

Make it easy to implement new algorithm

ideas.

Provide tools to evaluate,

analyse

and

compare

the algorithms' performance. Cross-validation procedures can be run very

easily using powerful CV iterators (inspired by

scikit-learn excellent tools), as well as

exhaustive search over a set of

parameters.

The name SurPRISE (roughly :) ) stands for Simple Python RecommendatIon

System Engine.

Please note that surprise does not support implicit ratings or content-based

information.

Getting started, example

Here 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 the

SVD

algorithm.

from surprise import SVD

from surprise import Dataset

from surprise.model_selection import cross_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.06

Benchmarks

Here 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 the Movielens 100k 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 the benchmark

example.

0.934

0.737

0:00:11

0.92

0.722

0:09:03

0.963

0.758

0:00:15

0.946

0.743

0:00:08

0.98

0.774

0:00:10

0.951

0.749

0:00:10

0.931

0.733

0:00:12

0.963

0.753

0:00:03

0.944

0.748

0:00:01

1.514

1.215

0:00:01

0.873

0.686

0:02:13

0.862

0.673

2:54:19

0.916

0.724

0:02:31

0.907

0.715

0:02:31

0.923

0.727

0:05:27

0.929

0.738

0:05:43

0.895

0.706

0:05:55

0.915

0.717

0:00:31

0.909

0.719

0:00:19

1.504

1.206

0:00:19

Installation

With pip (you'll need numpy, and a C compiler. Windows

users might prefer using conda):

$ pip install numpy

$ pip install scikit-surprise

With conda:

$ conda install -c conda-forge scikit-surprise

For the latest version, you can also clone the repo and build the source

(you'll first need Cython and

numpy):

$ pip install numpy cython

$ git clone https://github.com/NicolasHug/surprise.git

$ cd surprise

$ python setup.py install

License and reference

This project is licensed under the BSD

3-Clause license, so it can be

used for pretty much everything, including commercial applications. Please let

us know how Surprise is useful to you!

Please make sure to cite the

paper if 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}

}

Contributors

The following persons have contributed to Surprise:

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 Status

Starting 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 about Surprise,

please use the GitHub project page.

Please don't send emails (we will not answer).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值