I am following a blog post - Diversifying your portfolio.
One of the queries requires to call the Pearson Similarity algorithm, i have downloaded the GDS plugin.
My neo4j Desktop version is 5.12.0 and GDS library version is 2.6.0
This is the error message i got.
'There is no procedure with the name gds.alpha.similarity.pearson.write registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.'
This blog-post is based on an old version of GDS and unfortunately does not reflect the current state of the library.
In particular, the procedure gds.alpha.similarity.pearson.write has been removed.
You can instead use gds.knn.write in its place, by specifying the similarity metric to be equal to Pearson.
This is achieved by setting the configuration parameter nodeProperties to {input: 'Pearson'}, where input` is the name of your property.
You can read more about the way the algorithm works on the documentation page.
There is one more crucial thing to consider:
Since version 2.0.0 of the library, to execute any algorithm you must first project your graph from neo4j to gds. You can read more about this concept on the documentation page.
Here are the two queries that will allow you to compute the pearson similarity between stocks
Depending on the needs of the rest of the tutorial, you might have to project different graphs, and you can use gds.graph.drop to drop existing ones that you do not need anymore.
Let us know if the above solves your problem or if you need any more help,
The louvain algoritmh is still available ( see the docs for more information). The reason why the above query fails is again due to GDS dropping support for anonymous projections.
So, what you need to do is project another graph, with the SIMILAR relationship type
Note that, you can also use mutate mode on the first knn query, which would add the relationships not in the neo4j database, but rather the projected graph (in this case graph), which would then alow you to execute louvain without the need to perform another projection.
These are all covered in the documentation pages I have linked in the topic, and they are in general useful concepts to know when working with GDS to make the user experience as simple as possible.
I hope that this gives you a way forward!
Best regards,
Ioannis.
P.S Your louvain results might be slightly different than what is shown in the post, as we have modified its behavior since that time (I am personally finding five communities instead of four)
the following query when used in neo4j doesnt load/show any results.
MATCH (s:Stock)-[:TRADING_DAY]->(day)
WHERE NOT exists { ()-[:NEXT_DAY]->(day) }
MATCH p=(day)-[:NEXT_DAY*0..]->(next_day)
SET next_day.index = length(p)
Apologies for asking multiple questions.
Really appreciate your support! :)
What output were you expecting from this code segment?
When I execute from my neo4j browser, I get the following output Set 9180 properties, completed after 2123 ms.
This is a SET operation, which assigns node properties, so it shouldn't return anything more besides that. As you can see in that notebook, there is no output following the execution of the query.