Advertisement

学习笔记(十二):推荐系统-隐语义模型

阅读量:

以下代码来源于唐宇迪《推荐系统》视频课程,所使用数据集获取自http://pan.baidu.com/s/1eS5VZ8Y中的“ml-1m"数据

复制代码
 from collections import deque

    
 from six import next
    
 import readers
    
  
    
 import tensorflow as tf
    
 import numpy as np
    
  
    
 import time
    
  
    
 np.random.seed(42)
    
 u_num = 6040
    
 i_num = 3952
    
  
    
 batch_size = 1000
    
 dims = 5
    
 max_epochs = 50
    
 place_device = "/cpu:0"
    
  
    
 def get_data()
    
     df = readers.read_file("./ml-1m/ratings.dat",sep = "::")
    
     rows = len(df)
    
     df = df.iloc[np.random.permutation(rows)].reset_inde

全部评论 (0)

还没有任何评论哟~