[MRG+2] warning for PCA with sparse input#7649
Conversation
|
Huh? If I don't think a warning followed by an exception is an improvement; but the exception should be raised and this behaviour tested. |
|
I think the point in #7642 is that, since there is an instruction subtracting the mean, the developer did not have in mind to support input sparsity in pca. This is indeed the case and in fact there is a The issue converged to the point that the error is not informative enough and misled people into using sparse input with pca. What do you suggest instead of the additional warning? I don't like it very much either |
|
You can immediately raise an error instead of a warning? |
b792b1a to
a0fa52b
Compare
|
Now: raising an error and testing it. |
|
test failure |
705795c to
952d042
Compare
|
Should be fixed now. |
|
|
||
| def test_pca_spase_input(): | ||
|
|
||
| X = np.random.rand(5, 4) |
There was a problem hiding this comment.
You need to use a seeded RNG, for instance "X = np.random.RandomState(0).rand(5, 4)". We really don't want to leave any non seeded RNG in the test suite.
There was a problem hiding this comment.
Can't believe I forgot this :) Thanks.
|
+1 aside the minor change I asked for. |
952d042 to
85bcc41
Compare
|
+1. @jnothman : do you still have changes requests, or are you +1? |
|
LGTm |
Fix for #7642.