添加现有节点属性以链接neo4j中的预测管道?

问题描述 投票:0回答:1

如何将图形投影中节点的现有节点属性添加到 ML 管道?

据我所知,

gds.beta.pipeline.linkPrediction.addNodeProperty
过程采用不同的其他过程来创建节点嵌入作为管道的新节点属性,但如何添加现有节点嵌入?即使属性已投影到内存图中,也会出现以下错误。

无法调用过程 gds.beta.pipeline.linkPrediction.train:原因为:java.lang.IllegalArgumentException:功能步骤中定义的节点属性 [property1、property2、property3] 不存在于图形或部分管道中

neo4j
1个回答
0
投票

您可以通过将现有节点属性添加到图形投影中来将其添加到链接预测管道 ->

CALL gds.graph.project('test', 'Node', 'Relationship', {nodeProperties: ['property'1]})

然后您可以通过定义链接特征将其用于链接预测管道:

CALL gds.beta.pipeline.linkPrediction.addFeature('pipe', 'hadamard', {
  nodeProperties: ['property1']
}) YIELD featureSteps

您可以拥有多个链接功能。仅当您想要执行图算法来计算新属性时才使用

addProperty
方法,例如 fastRP 嵌入的示例。

CALL gds.beta.pipeline.linkPrediction.addNodeProperty('pipe', 'fastRP', {
  mutateProperty: 'embedding',
  embeddingDimension: 256,
  randomSeed: 42
})

如果节点属性已存在于投影图中,您可以跳过添加节点属性步骤。

© www.soinside.com 2019 - 2024. All rights reserved.