cancel
Showing results for 
Search instead for 
Did you mean: 

Unknown function 'gds.alpha.similarity.asVector'

rgerster99
Node

Hey,
I accessed the guide on https://guides.neo4j.com/sandbox/recommendations and found a way to get similair users to myself.
The full query is:

MATCH (p1:User {id:"220"})-[x:RATED]->(movie:Movie)
WITH p1, gds.alpha.similarity.asVector(movie, x.rating) AS p1Vector
MATCH (p2:User)-[x2:RATED]->(movie:Movie) WHERE p2 <> p1
WITH p1, p2, p1Vector, gds.alpha.similarity.asVector(movie, x2.rating) AS p2Vector
WHERE size(apoc.coll.intersection([v in p1Vector | v.category], [v in p2Vector | v.category])) > 10
RETURN p1.name AS from,
p2.name AS to,
gds.alpha.similarity.pearson(p1Vector, p2Vector, {vectorType: "maps"}) AS similarity
ORDER BY similarity DESC
LIMIT 100

When I test the code in Neo4j Aura I get an error Unknown function 'gds.alpha.similarity.asVector'. I visited the docs and found that there is a new version so I tried to use gds.similarity.asVector instead but I get the same type of error. Am I missing some sort of import or is this not the correct way to use the function?

1 REPLY 1

AuraDB does not have the GDS library.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.