# Using Graph embeddings for other than training an ML model

**URL:** <https://community.neo4j.com/t/using-graph-embeddings-for-other-than-training-an-ml-model/40455>\
**Category:** Graph Data Science / Graph Analytics\
**Created:** [June 26, 2021, 5:05pm UTC](https://community.neo4j.com/t/using-graph-embeddings-for-other-than-training-an-ml-model/40455 "2021-06-26T17:05:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stu\_v\_kerr](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/stu_v_kerr/32/691_2.png) [@stu\_v\_kerr](https://community.neo4j.com/u/stu_v_kerr)\
**Post date:** [June 26, 2021, 5:05pm UTC](https://community.neo4j.com/t/using-graph-embeddings-for-other-than-training-an-ml-model/40455/1 "2021-06-26T17:05:04Z")

</div>

System:  
Neo4J 4.2.7 (Enterprise)  
GDS 1.6.0

Can graph embeddings, when written to the graph nodes as a property, be used in algorithms other than for training a machine learning model? For example, can embeddings be used in Centrality, Community Detection and Similarity algorithms? What are the restrictions if any?

BTW: Thanks to Alicia and her team for mending the seam that existed previously from having to export graph data out of Neo4J into Python in order to perform machine learning. Looking forward to using your next GDS versions!

---

<div class="post-metadata">

**Author:** ![alicia\_frame1](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/alicia_frame1/32/6998_2.png) [@alicia\_frame1](https://community.neo4j.com/u/alicia_frame1)\
**Post date:** [June 28, 2021, 12:02pm UTC](https://community.neo4j.com/t/using-graph-embeddings-for-other-than-training-an-ml-model/40455/2 "2021-06-28T12:02:53Z")

</div>

Graph embeddings (either having been written back to your database, or just mutating your in-memory graph) can be used to run [K-Nearest Neighbors](https://neo4j.com/docs/graph-data-science/current/algorithms/knn/#algorithms-knn) to build a similarity graph. Once you've done that, you can run any of the traditional graph algorithms (community detection, centrality, etc) on your new `SIMILAR_TO` relationship.

Graph embeddings return `list` properties - a bunch of numbers that describe each node relative to the rest of the graph - and those properties can be used in any algorithms that accept them (current, similarity, other embeddings, and ML). But if you use them to construct new relationships, you can run traditional algorithms over your similarity graph.

We're thrilled your enjoying the library!

---

<div class="post-metadata">

**Author:** ![stu\_v\_kerr](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/stu_v_kerr/32/691_2.png) [@stu\_v\_kerr](https://community.neo4j.com/u/stu_v_kerr)\
**Post date:** [June 28, 2021, 2:11pm UTC](https://community.neo4j.com/t/using-graph-embeddings-for-other-than-training-an-ml-model/40455/3 "2021-06-28T14:11:56Z")

</div>

Thank you Alicia.  
I was just going to ask you about using cosine similarity in n-dimensional space (i.e., an embedding), but i see the KNN algorithm does that:

```auto
When the property is a list of floating-point numbers, the similarity is 
computed using the cosine similarity metric. 
See the Cosine Similarity algorithm for more details.

```

Very nice.
