簡體   English   中英

將現有節點屬性添加到 neo4j 中的鏈接預測管道?

[英]Add existing node properties to link prediction pipeline in neo4j?

如何將圖形投影中節點的現有節點屬性添加到 ML 管道?

據我所知, gds.beta.pipeline.linkPrediction.addNodeProperty過程采用不同的其他過程來創建節點嵌入作為管道的新節點屬性,但是如何添加現有的? 即使屬性投影在 memory 圖中,也會出現以下錯誤。

Failed to invoke procedure gds.beta.pipeline.linkPrediction.train: Caused by: java.lang.IllegalArgumentException: Node properties [property1, property2, property3] defined in the feature steps do not exist in the graph or part of the pipeline

您可以通過將現有節點屬性添加到圖形投影中來將現有節點屬性添加到鏈接預測管道 ->

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
})

如果投影圖中已經存在節點屬性,則可以跳過添加節點屬性步驟。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM