Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-01-2021 11:25 PM
I am trying to run a ML Node Classification based on the GDS plugin, but I am giving an error that I don't know where it comes from. Explanation:
CALL gds.graph.create(
"graph",
"*",
"*",
{
nodeProperties: ["bornDate", "gender"],
}
)
(there are 3 node labels in my database only: Persons, Cities and Test types - COVID tests- )
CALL gds.alpha.ml.nodeClassification.train(
"graph", {
nodeLabels: ["Person"],
modelName: "ncModel",
featureProperties: ["gender"],
targetProperty: "mlNodeClassification",
randomSeed: 2,
holdoutFraction: 0.4,
validationFolds: 5,
metrics: ["F1_WEIGHTED"],
params: [
{penalty: 0.0625},
{penalty: 0.5}
]
})
(I only use gender
as demonstration purpose). But I am giving this error:
Failed to invoke procedure `gds.alpha.ml.nodeClassification.train`: Caused by: java.lang.IllegalArgumentException: The feature properties ['gender'] are not present for all requested labels. Requested labels: ['Person']. Properties available on all requested labels: []
MATCH (n:Person)
WHERE n.gender IS NULL
RETURN count(*)
And retrieves 0
. So I am not able to understand the error shown in the second item
08-02-2021 11:36 AM
Hi.
I am wondering if there is a reason that you are including all node types in your in-memory graph? I don't imagine that Cities and Test types have genders. What happens if you repeat the node classification algorithm using just the Person nodes in your in-memory graph?
08-08-2021 08:13 AM
Hi @dvalcarcer!
You'll need to change a few things:
*
schema, the labels are no longer retained in the in memory graph, so the Person
label is no longer available. You'll need to load your graph with the specific node labels you need.defaultValue
for any properties that aren't available on a specific node lab... (eg. if you have people and places, and people nodes have an age but place don't, you'll want to assign a default age of 0 to all places)In order to not end up with orphan (disconnected) nodes with no information to learn, you'll likely need to load all your node labels and relationship types, or use a cypher projection to create a (:Person)-[]->(:Person)
graph
All the sessions of the conference are now available online