cancel
Showing results for 
Search instead for 
Did you mean: 

Use Person Similarity algorithm

iganea9
Node Link

Error by using Pearson Similarity algorithm.
Indicates 3 arguments, but there are 2 ('params' and 'rel.weight')

MATCH(knop:Compound{prep:'Control'})-[rel:HAS]->(params)

WITH knop, gds.alpha.similarity.asVector(params, rel.weight) AS cVector

MATCH(p1h:Compound)-[rel:HAS]-> (params) WHERE p1h <> knop

WITH knop, p1h, cVector, gds.alpha.similarity.asVector(params, rel.weight) AS p1hVector

RETURN knop.prep AS from, p1h.prep AS to, gds.alpha.similarity.asVector(cVector, p1hVector, {vectorType:'maps'}) AS similarity

ORDER BY similarity DESC

4 REPLIES 4

glilienfield
Ninja
Ninja

You use of asVector in your return statement has three parameters. One is even a map. Is that a valid parameter.

I modified the query and got Null

glilienfield
Ninja
Ninja

You must not have a weight property defined on your ‘compound’ nodes.

glilienfield
Ninja
Ninja

In your first example, I think the issue is on line 5, were you should be calling pearson method, not asVector method.

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.