Neo4j中的”Heterogeneous”是什么?

huangapple go评论63阅读模式
英文:

What's the Heterogeneous in Neo4j?

问题

Graph

Neo4j中的”Heterogeneous”是什么?

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

Neo4j中的”Heterogeneous”是什么?

Question

结果让我困惑于图的结构是否能执行 FastRP,因为嵌入结果无法解释。

因此,我查看了 FastRP 文档
文档中提到:"该算法不支持 Heterogeneous 案例"。

Neo4j 中的异构图是什么?
我的案例是异构的吗?
(customer 节点之间没有相互连接)

此外,以下图是从 Neo4j 学习课程创建的:

CALL gds.graph.project('proj', ['Movie', 'Person'], {
ACTED_IN:{orientation:'UNDIRECTED'},
DIRECTED:{orientation:'UNDIRECTED'}
});

这种情况是异构的吗?
(此案例用于执行 FastRP

英文:

Graph

Neo4j中的”Heterogeneous”是什么?

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

Neo4j中的”Heterogeneous”是什么?

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)

huangapple
  • 本文由 发表于 2023年6月8日 13:29:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/76428849.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定