Making predictions
In order to make predictions, we are going to use the same projected graph that already contains the test nodes.
With this projected graph, and the model object returned by the pipeline training, we can now predict the class of new nodes:
predictions = model.predict_stream( projected_graph_object, targetNodeLabels=["Test", "Train"], )
Note that the model object also exposes a predict_mutate
function to store the results in the projected graph. This will be useful to us when dealing with embedding features in the last section of this chapter.
In the preceding code block, we include both the Test
and Train
nodes in order for the Louvain results to be computed properly, using the whole graph. We will filter out the predictions for the train nodes as we evaluate the model performances.
For instance, in order to evaluate our model, we can compute the confusion matrix using our...