Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero-division error not occuring, leading to the nipalsPCA never converging and running untill stopped #51

Open
martinbo94 opened this issue Feb 24, 2022 · 1 comment

Comments

@martinbo94
Copy link

After some debugging I found out that a feature in my dataset contained only zeros, which lead to errors in the standardisation process of the nipalsPCA when trying to divide by a std of 0. Perhaps there should be some handling of zero-values or at least a check if a column contains only zero values or other constants in-which the standard deviation is 0 and then throw an error. In my case, the code just ran until manually stopped instead of throwing a zero-division error.

When Xstand = True, the code runs untill manually stopped and gives the warning
RuntimeWarning: invalid value encountered in true_divide
self.arrX = (self.arrX_input - self.Xmeans) / self.Xstd

When Xstand = False, the code runs untill manually stopped and gives the warning
RuntimeWarning: invalid value encountered in true_divide
p = num / denom

@olivertomic
Copy link
Owner

Thank you for reporting this issue, @martinbo94. I agree, there should be a more specific feedback that standardisation will not work if the data has one or more columns with zero variance. We'll try to update this as soon as we can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants