Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[MRG+1] BUG Avoid unexpected error in PCA when n_components='mle' #9886
What does this implement/fix? Explain your changes.
Currently, in python3.X, when we call PCA with large dataset (max(X.shape) > 500) and n_components='mle' without explicitly setting svd_solver='full', we will get an error.
Any other comments?
referenced this pull request
Oct 8, 2017
@jnothman Thanks for the instant review :)
I have updated the document. Since the paragraph seems to be too long, I have splitted it into several parts.
We already have a test below it (test_pca_dim) to test the correctness of n_components_ set by mle with a simple case. It seems hard to calculate n_components_ set by mle in difficult case like current test. So it you still think we need to further test n_components_ set by mle, please give me some suggestions.
def test_pca_dim(): # Check automated dimensionality setting rng = np.random.RandomState(0) n, p = 100, 5 X = rng.randn(n, p) * .1 X[:10] += np.array([3, 4, 5, 1, 2]) pca = PCA(n_components='mle', svd_solver='full').fit(X) assert_equal(pca.n_components, 'mle') assert_equal(pca.n_components_, 1)
Oct 9, 2017
6 checks passed
Personally, I'd rather keep 0.19.1 as focussed on issues specific to that release as possible, within reason.…
On 9 October 2017 at 20:03, Olivier Grisel ***@***.***> wrote: Yes, if we backport to 0.19.1 we will adjust the location of the what's new entry. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#9886 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAEz64qm9QwMSsmmVhMjyBPkpIAU3z6Jks5sqeFcgaJpZM4Pxslz> .