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
PLS reports "array must not contain nan" if a feature is constant #13609
Comments
What would you like to see instead? An assertion when the |
Already we raise an error. Better that we actually do the pls but disregard
the 0-variance column. See some of the comments at the original post.
|
As far as I understand we need to remove the warning message keeping the correct answer (when line yy[3,:] = [1,0,0,0,0] is uncommented ). |
That's ok with me :)
…On Wed, 17 Apr 2019, 00:46 iodapro, ***@***.***> wrote:
As far as I understand we need to remove the warning message keeping the
correct answer (when line yy[3,:] = [1,0,0,0,0] is uncommented ).
Can I try to solve this issue if nobody minds?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#13609 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Af8KsEcpWvUXFQhRVgyeBbVCyvCxEwpEks5vhmDBgaJpZM4cmyf4>
.
|
I'm not an expert on PLS; I was relying on the comments historically related to this issue to describe it as a simple fix. But certainly the problem is constant features. Go ahead and submit a pull request, @iodapro |
@jnothman there is something I can't undestand about the example you give in the issue: Even when we are uncommenting the line yy[3,:] = [1,0,0,0,0], the third column of yy is constant, but in that case pls2.fit(xx, yy) works. Do we need two columns to be constant for the PLS to fail? |
After taking a deeper look at the problem, the problem is not constant features. The problem is that the first column of the target (yy) is constant. For instance, this case will work (constant features and some constant columns in the target that are not the first column):
But this case won't (the first column in the target is a constant):
This is because the first step of the |
Originally reported at #2089 (comment) by @Franck-Dernoncourt. Reproduce with:
The obscure error message is due to the presence of a column containing only 0.
The text was updated successfully, but these errors were encountered: