Skip to content

SVD truncation  #3

Description

@skojaku

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions