Couldnt use Cosine similarity Algorithm in my Neo4j Desktop

Getting unknown function 'algo.similarity.cosine' while trying to use RETURN algo.similarity.cosine([3,8,7,5,2,9], [10,8,6,6,4,5]) AS similarity in community edition Neo4J Desktop

Reference:Similarity - Neo4j Graph Data Science

I have installed graph algorithm install for the whole project .

I have this,algo. enabled in my config.

When i execute CALL algo.list() , i'm not seeing 'algo.similarity.cosine' procedure/function listed .but could see lot of other algo.* functions and procs

Am i missing anything ? Help is much appreciated .

You may be using an older version of the algo library.

Cosine and other similarity functions and procedures were only added with the latest release. I believe this is only compatible with the 3.4.x versions of Neo4j.

You may need to stop your db, uninstall the plugin, and install again (you should see the version change upon uninstalling the older version).

Thanks Andrew for quick response , I tried installing the plugins with latest version of Neo4j db installed , getting plugin not supported error . Am i still missing something .!


Thanks in advance for your help with this.

It works when i use 3.4.7 exactly ... earlier it didnt work for latest version (3.4.8) ...

Thanks for you help Andrew.

3.4.8 was just released, Desktop needs to be modified to allow installation of the libraries. Also, if any code changes are needed to work with the latest version that may require an additional release to the algo library, but that's not always the case.

1 Like