// Create Projection
CALL gds.graph.project('project', ['customer', 'PRODUDCTION'], {HAS_PURCHASED: {orientation: 'UNDIRECTED'}});
// Run FastRP
CALL gds.fastRP.stream('project', {
randomSeed: 7474,
embeddingDimension: 4
})
YIELD nodeId, embedding
WITH gds.util.asNode(nodeId) AS n, embedding
WHERE n:customer
RETURN id(n), n.en_name, embedding
The result let me confusing the structure of graph can perform FastRP
or not,
because the unexplainable embedding result.
Therefore I go to see the document of fastRP,
and the document say: "the algorithm not supported Heterogeneous
case"
What's the heterogeneous graph in neo4j ?
Is my case heterogeneous ? (which node of customer doesn't link to each other)
Futhermore, the following graph which created from learning course of neo4j:
CALL gds.graph.project('proj', ['Movie', 'Person'], {
ACTED_IN:{orientation:'UNDIRECTED'},
DIRECTED:{orientation:'UNDIRECTED'}
});
Is the case heterogeneous ?
(this case is used to do FastRP
)
I agree the heterogeneous description at the top was confusing. This is improved in the upcoming version.
FastRP does not use the label information on the node for the embedding. So your heterogeneous graph is treated as homogeneous. But if the labels can already be inferred from the graph structure, the embeddings can still be good. So it depends on how much additional information the labels provide.
Your questionable embeddings in your example are a result of nodes with no outgoing relationship. To handle these, you can either load the graph undirected or look into the nodeSelfInfluence parameter.
See the preview docs for more details (https://neo4j.com/docs/graph-data-science/2.4-preview/machine-learning/node-embeddings/fastrp/#algorithms-embeddings-fastrp-node-self-influence)