gcn icon indicating copy to clipboard operation
gcn copied to clipboard

Confusion matrix for node-wise classifications

Open Spencerkt opened this issue 7 years ago • 2 comments

I'm hoping to output a confusion matrix for node-wise binary classification after training is complete.

Do you have a way you recommend I go about doing this? I've tried using tf.confusion_matrix where the labels input is y_test and the predictions input is the vector from model.outputs (which is coming from a modification to your evaluate function). This has it's issues though, because (I think) model.outputs is the output of an activation function and not the classification itself.

Is there a better way to go about this, or is there something I'm missing?

Spencerkt avatar May 15 '18 20:05 Spencerkt

Scikit learn has some convenience functions for creating confusion matrices: http://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion_matrix.html

Just provide the predicted classes and the true labels. You might need to perform an argmax or max operation on the output of the GCN model to get the predicted classes (as I think the model just gives you probabilities).

Hope this helps.

tkipf avatar May 16 '18 09:05 tkipf

Hi @Spencerkt how did you get the model outputs for just the test dataset?

m-saksena avatar May 09 '19 17:05 m-saksena