Hi @Aghasemian
Just spotted a potential bug in the code:
https://github.com/Aghasemian/OptimalLinkPrediction/blob/ce6b1934bab396b8e6283c3afab343ab2aea830f/Code/OLP.py#L429C5-L434
Here, the singular values with large magnitude are assumed to be positive, though in the singular value decomposition, the sign is not uniquely determined. Consequently, it could happen that the principal component is truncated when it is associated with negative singular values.
I think the right implementation is to take the magnitude by np.abs(sig) before truncation.
Hi @Aghasemian
Just spotted a potential bug in the code:
https://github.com/Aghasemian/OptimalLinkPrediction/blob/ce6b1934bab396b8e6283c3afab343ab2aea830f/Code/OLP.py#L429C5-L434
Here, the singular values with large magnitude are assumed to be positive, though in the singular value decomposition, the sign is not uniquely determined. Consequently, it could happen that the principal component is truncated when it is associated with negative singular values.
I think the right implementation is to take the magnitude by
np.abs(sig)before truncation.