Go语言版推荐算法程序,暂时只实现了LFM(Latent Factor Mode,潜在因子模型)算法
conf目录下的StorageCfg.json文件为数据库和Redis服务器配置文件。
执行方法:
- 单线程版 ./recommend lfm
- 多线程版 ./recommend lfm mp
lfm/initVisitor.go文件中所使用的数据表pms_product_visit_record必须有的字段:
字段 | 类型 | 说明 |
visitor | String | 访问者 |
spu | Int | SPU |
sku | Int | SKU |
date | Date | 访问日期 |
weight | Int | 操作权重 |
click_num | Int | 点击次数 |
cart_num | Int | 加购次数 |
fav_num | Int | 收藏次数 |
order_num | Int | 下单次数 |