英文:
What's the Heterogeneous in Neo4j?
问题
Graph
Code
// 创建投影
CALL gds.graph.project('project', ['customer', 'PRODUDCTION'], {HAS_PURCHASED: {orientation: 'UNDIRECTED'}});
// 运行 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
Result
Question
结果让我困惑于图的结构是否能执行 FastRP
,因为嵌入结果无法解释。
因此,我查看了 FastRP 文档,
文档中提到:"该算法不支持 Heterogeneous
案例"。
Neo4j 中的异构图是什么?
我的案例是异构的吗?
(customer 节点之间没有相互连接)
此外,以下图是从 Neo4j 学习课程创建的:
CALL gds.graph.project('proj', ['Movie', 'Person'], {
ACTED_IN:{orientation:'UNDIRECTED'},
DIRECTED:{orientation:'UNDIRECTED'}
});
这种情况是异构的吗?
(此案例用于执行 FastRP
)
英文:
Graph
Code
// 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
Result
Question
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
)
答案1
得分: 0
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)
英文:
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)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论