The number of non-zero elements in projection vector for LODA
Author: tam17akiCreated Jun 8, 2023Updated Sep 16, 2026
In the current implementation of LODA, the number of non-zero elements in projection vector is specified as
n_nonzero_components = np.sqrt(n_components)where n_components is the dimensionarity of the feature vector.
cf., https://github.com/yzhao062/pyod/blob/master/pyod/models/loda.py#L94
However, from the original peper of LODA, we can see that projection vectors with $d^{-1/2}$ non-zero components are required, where $d$ is the dimensionarity of the feature vector.
Therefore, I think it should be fixed as np.sqrt(-n_components), though I'm not sure.
Best regards, Akira.
Source: yzhao062/pyod