协同过滤:
使用网络中其他用户的首选项,评级和操作来查找要推荐的项目。
(买这个东西的用户,还买了那个东西)
用户Misty Williams的所有评分
// Show all ratings by Misty Williams
MATCH (u:User {name: "Misty Williams"})
MATCH (u)-[r:RATED]->(m:Movie)
RETURN *;
查找Misty的平均评分:
// Show all ratings by Misty Williams
MATCH (u:User {name: "Misty Williams"})
MATCH (u)-[r:RATED]->(m:Movie)
RETURN avg(r.rating) AS average;
哪些是Misty 评分超过平均分的电影:
// What are the movies that Misty liked more than average?
MATCH (u:User {name: "Misty Williams"})
MATCH (u)-[r:RATED]->(m:Movie)
WITH u, avg(r.rating) AS average
MATCH (u)-[r:RATED]->(m:Movie)
WHERE r.rating > average
RETURN m;
由此,通过计算Misty 评过分的电影,而且找出受到他好评的电影,推荐给其他用户,就是协同过滤最基本的做法。
网友评论