GitHub开源推荐系统项目Surprise的安装和使用

转载请注明出处:http://blog.csdn.net/chen19920219/article/details/76905381


最近在GitHub上发现了一个很好的开源推荐系统,Star700多,包含了常用的矩阵分解算法,包括SVD,SVD++,NMF等等,GitHub地址:https://github.com/NicolasHug/Surprise,由于安装和使用过程中有许多坑,特此记录下来:

 

Surprise安装

官方文档中显示安装环境为Python2.7或者3.5,我的环境为3.5,其他没试过。

 

首先,文档显示有两种安装方法,这里使用第一种安装方法

$ pip install numpy

$ pip install scikit-surprise

 

在安装之前首先确认安装了numpy模块,然后在安装surprise时,老是报错,错误为unable to findvcvarsall.bat,网上搜了下解决办法链接为:

http://jingyan.baidu.com/article/adc815138162e8f723bf7387.html

然后重新pipinstall scikit-surprise就好了。

 

Surprise 使用

Surprise里有自带的数据集,自带的数据集加载方法和加载自己数据集的方法不同。加载项目提供的数据集就不多说了,这里重点说下Surprise怎么加载自己本地的数据集以及经常使用的方法。

官方API提供了加载本地数据集的方法:

 

Load a custom dataset

You can of course use a custom dataset. Surprise offerstwo ways of loading a custom dataset:

·        you can either specify a single file with all the ratingsand use the split () method to performcross-validation ;

·        or if your dataset is already split into predefinedfolds, you can specify a list of files for training and testing.

Either way, you will need to define a 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值