Learn practical skills, build real-world projects, and advance your career

Exploring graph embeddings: DeepWalk and Node2Vec

Why do we need node embeddings?

Let’s imagine you need to solve a scenario like the following one:

  • We have the interaction of users in a social network and we need to predict when two users are connected. Nodes represent users and edges represent when two users are “friends”. (Link prediction task)

  • We have a citation network of research publications and we need to predict the topic of each publication. Nodes represent the publications and edges are citations from one publication to another. (Node prediction task)

  • We have a set of proteins that are classified as enzymes or non-enzymes. Nodes represent the amino acids and two nodes are connected by an edge if they are less than 6 Angstroms apart. (Graph classification task)

For all the mentioned tasks we need to have a representation of the nodes.

So, if we need to run our machine learning algorithm we need to transform our graph structure into a vectorial space. Here we can find two main methods DeepWalk and Node2Vec.