Hi, I am new to Neo4j. I am trying to build a node classification model with binary classes. I created new features using Centrality Algorithms (such as Eigenvector & Betweensess Centrality). I have used the 'Write' Syntax to add the centrality output values back as node properties to my projected graph
However, when I proceed to add this Node Property by scaling it and proceed to training step, I hit into errors saying not all my nodes have this node property.
-
Add Node Property Step
</> CALL gds.beta.pipeline.nodeClassification.addNodeProperty('pipe-with-context1', 'scaleProperties', {
nodeProperties: 'eigenvector_centrality',
scaler: 'Mean',
mutateProperty:'scaledEigen',
contextNodeLabels: ['keys']
})
YIELD name, nodePropertySteps </> -
Select Feature Step
</> CALL gds.beta.pipeline.nodeClassification.selectFeatures('pipe-with-context2', ['scaledEigen'])
YIELD name, featureProperties </> -
Training Step
</> CALL gds.beta.pipeline.nodeClassification.train('myGraph', {
pipeline: 'pipe-with-context2',
targetNodeLabels: ['labelled_values'],
modelName: 'nc-pipeline-model-contextual',
targetProperty: 'class',
randomSeed: 1337,
metrics: ['ACCURACY']
}) YIELD modelInfo, modelSelectionStats
RETURN
modelInfo.bestParameters AS winningModel,
modelInfo.metrics.ACCURACY.train.avg AS avgTrainScore,
modelInfo.metrics.ACCURACY.outerTrain AS outerTrainScore,
modelInfo.metrics.ACCURACY.test AS testScore,
[cand IN modelSelectionStats.modelCandidates | cand.metrics.ACCURACY.validation.avg] AS validationScores </>
This is the snippet of error message I got:
I have checked, all the nodes seem to have these centrality properties.
Appreciate guidance/help on this. Thank you.