userIdmovieIdratingtimestamp
9999967162682.51065579370
10000067162694.01065149201
10000167163654.01070940363
10000267163852.51070979663
10000367165653.51074784724
movieIdtitlegenres
9120162672Mohenjo Daro (2016)Adventure|Drama|Romance
9121163056Shin Godzilla (2016)Action|Adventure|Fantasy|Sci-Fi
9122163949The Beatles: Eight Days a Week - The Touring Y...Documentary
9123164977The Gay Desperado (1936)Comedy
9124164979Women of '69, UnboxedDocumentary
movieIdtitlegenresmovieRow
9120162672Mohenjo Daro (2016)Adventure|Drama|Romance9120
9121163056Shin Godzilla (2016)Action|Adventure|Fantasy|Sci-Fi9121
9122163949The Beatles: Eight Days a Week - The Touring Y...Documentary9122
9123164977The Gay Desperado (1936)Comedy9123
9124164979Women of '69, UnboxedDocumentary9124
movieRowmovieIdtitle
91209120162672Mohenjo Daro (2016)
91219121163056Shin Godzilla (2016)
91229122163949The Beatles: Eight Days a Week - The Touring Y...
91239123164977The Gay Desperado (1936)
91249124164979Women of '69, Unboxed
userIdmovieRowrating
01302.5
17303.0
231304.0
332304.0
436303.0
第三步:构建模型
loss =1/2* tf.reduce_sum(((tf.matmul(X_parameters, Theta_parameters, transpose_b = True) - rating_norm) * record) **2) +1/2* (tf.reduce_sum(X_parameters **2) + tf.reduce_sum(Theta_parameters **2))#基于内容的推荐算法模型
函数解释:
reduce_sum() 就是求和,reduce_sum( input_tensor, axis=None, keep_dims=False, name=None, reduction_indices=None)
reduce_sum() 参数解释:
查看训练结果
在终端输入 tensorboard --logir=./
第五步:评估模型
4037.9002717628305
第六步:构建完整的电影推荐系统
本文章内容来自慕课网,仅供学习,如有侵权,联系删除
欢迎大家关注我的博客:https://home.cnblogs.com/u/sm123456/
欢迎大家加入千人交流学习群:125240963
网友评论