8.4.8 Inferring a Graphlet Vector
You can infer the vector representation for a given new graphlet as described in the following code:
Inferring a Graphlet Vector Using
JShell
opg4j> var graphlet = session.readGraphWithProperties("<path>/<graphletConfig.json>");
opg4j> inferredVector = model.inferGraphletVector(graphlet);
opg4j> inferredVector.print();
Inferring a Graphlet Vector Using Java
PgxGraph graphlet = session.readGraphWithProperties("<path>/<graphletConfig.json>");
PgxFrame inferredVector = model.inferGraphletVector(graphlet);
inferredVector.print();
Inferring a Graphlet Vector Using Python
PgxGraph graphlet = session.read_graph_with_properties("<path>/<graphletConfig.json>")
inferredVector = model.infer_graphlet_vector(graphlet)
inferredVector.print()
The schema for the
inferredVector
will be similar to the following output:
+---------------------------------------------------------------+
| graphlet | embedding |
+---------------------------------------------------------------+
Parent topic: Using the Pg2vec Algorithm