I am using a graph autoencoder to perform link prediction on a graph. The issue is that the number of negative (absent) edges is about 100 times the number of positive (existing) edges. To deal with the imbalance of data, I use a positive weight of 100 in the computation of the BCE loss.
I get a very high AUC and AP (88% for both), but the balanced accuracy ((tp+tn)/2) is only 50% (as a random classifier).
Also, after converting the probability estimates to binary predictions, I compute the confusion matrix and get the following results:
TN = 0.0
FP = 1.0
FN = 0.0
TP = 1.0
The binary predictions show that the model always predicts 1 although both negative and positive edges are taken into account in the training.
Can anyone understand why the accuracy is 50%?