Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-09-2019 06:26 PM
I adapted the "9.5.3.3. Pearson Similarity algorithm function sample" query from https://neo4j.com/docs/graph-algorithms/3.5/labs-algorithms/pearson to the yelp sandbox between two users 'Jenn' and 'Audrey'. My query is at the bottom. I was expecting a single similarity score as the output but instead got a list of scores as below. Why am I getting this result? algo.similarity.asVector should have chained all the reviews into two vectors but I'm not sure this is happening in my case.
match (a1:User {name:'Jenn'})-[:WROTE]->(r1)-[:REVIEWS]->(b)
with a1, algo.similarity.asVector(b, r1.stars) as p1Vector
match (a2:User {name:'Audrey'})-[:WROTE]->(r2)-[:REVIEWS]->(b)
with a1, a2, p1Vector, algo.similarity.asVector(b, r2.stars) as p2Vector
return a1.name as from, a2.name as to, algo.similarity.pearson(p1Vector, p2Vector, {vectorType:"maps"}) as similarity
12-10-2019 01:09 AM
My bad. Just occurred to me that there are multiple 'Jenn' and 'Audrey' with different id in the graph. My query is just returning the similarity scores for different combinations of a1.id and a2.id.
All the sessions of the conference are now available online