0

如果我的节点看起来像:

{id: 1, name: "John", last_name: "Doe", age: 40, city: "New York", credit_score: 5.5}
{id: 2, name: "Linda", last_name: "Lumbo", age: 32, city: "Washington", credit_score: 5.5}
{id: 3, name: "Greg", last_name: "Tanta", age: 28, city: "New York", credit_score: 5.5}
{id: 4, name: "Donald", last_name: "Greenboim", age: 64, city: "Tel Aviv", credit_score: 5.5}
{id: 5, name: "Leo", last_name: "Greenhouse", age: 98, city: "Paris", credit_score: 5.5}
{id: 6, name: "John", last_name: "Opelbaum", age: 80, city: "Moscow", credit_score: 1}
{id: 7, name: "John", last_name: "Vein", age: 21, city: "Los Angeles", credit_score: 0.35}
{id: 8, name: "Dino", last_name: "Lodz", age: 34, city: "New York", credit_score: 1.5}
{id: 9, name: "Kurt", last_name: "Kreston", age: 89, city: "New York", credit_score: 5.3}
{id: 10, name: "Alex", last_name: "Mulo", age: 22, city: "Moscow", credit_score: 2.5}
{id: 11, name: "John", last_name: "Tolo", age: 32, city: "Liverpool", credit_score: 0.5}
{id: 12, name: "Trent", last_name: "Benson", age: 57, city: "London", credit_score: 5.114}
{id: 13, name: "Tom", last_name: "Richardson", age: 23, city: "New York", credit_score: 0.986}
....

考虑所有都是相互关联的,我想在属性上应用 GraphSAGE 算法。出于某种原因,当我的属性是字符串时,我无法获得嵌入。请指导我如何在具有字符串类型属性的节点上应用 GraphSAGE 算法?或混合(浮点、整数、字符串)。

Failed to invoke procedure gds.graph.create: Caused by: java.lang.UnsupportedOperationException: Loading of values of type String is currently not supported
4

1 回答 1

2

如果您想申请在字符串类型属性上运行 GraphSAGE,您需要应用一种热编码或其他一些技术将它们转换为数字列表中的数字。属性类型不能是各种数据类型的混合,它必须在所有属性中保持一致。AFAIK,这对任何包含 GraphSAGE 的库都有效,而不仅仅是 Neo4j GDS。

可能您可以跳过 id 属性,因为它不会带来任何附加信息。对于城市、姓名和姓氏,您可以使用一种热编码或词嵌入将这些属性包含在 GraphSAGE 中,由您决定。

于 2021-11-28T19:04:09.087 回答