{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4415","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4415/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4415/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4415/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/4415","id":62902149,"number":4415,"title":"MemoryError: LW: n_features is too large , when using shrinkage LDA with lsqr solver","user":{"login":"StevenLOL","id":5893788,"avatar_url":"https://avatars.githubusercontent.com/u/5893788?v=3","gravatar_id":"","url":"https://api.github.com/users/StevenLOL","html_url":"https://github.com/StevenLOL","followers_url":"https://api.github.com/users/StevenLOL/followers","following_url":"https://api.github.com/users/StevenLOL/following{/other_user}","gists_url":"https://api.github.com/users/StevenLOL/gists{/gist_id}","starred_url":"https://api.github.com/users/StevenLOL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevenLOL/subscriptions","organizations_url":"https://api.github.com/users/StevenLOL/orgs","repos_url":"https://api.github.com/users/StevenLOL/repos","events_url":"https://api.github.com/users/StevenLOL/events{/privacy}","received_events_url":"https://api.github.com/users/StevenLOL/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels/Bug","name":"Bug","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/12","html_url":"https://github.com/scikit-learn/scikit-learn/milestones/0.16","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/12/labels","id":527004,"number":12,"title":"0.16","description":"","creator":{"login":"GaelVaroquaux","id":208217,"avatar_url":"https://avatars.githubusercontent.com/u/208217?v=3","gravatar_id":"","url":"https://api.github.com/users/GaelVaroquaux","html_url":"https://github.com/GaelVaroquaux","followers_url":"https://api.github.com/users/GaelVaroquaux/followers","following_url":"https://api.github.com/users/GaelVaroquaux/following{/other_user}","gists_url":"https://api.github.com/users/GaelVaroquaux/gists{/gist_id}","starred_url":"https://api.github.com/users/GaelVaroquaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GaelVaroquaux/subscriptions","organizations_url":"https://api.github.com/users/GaelVaroquaux/orgs","repos_url":"https://api.github.com/users/GaelVaroquaux/repos","events_url":"https://api.github.com/users/GaelVaroquaux/events{/privacy}","received_events_url":"https://api.github.com/users/GaelVaroquaux/received_events","type":"User","site_admin":false},"open_issues":25,"closed_issues":137,"state":"closed","created_at":"2014-01-05T21:19:20Z","updated_at":"2015-09-09T22:56:32Z","due_on":"2015-03-15T04:00:00Z","closed_at":"2015-04-03T17:58:13Z"},"comments":15,"created_at":"2015-03-19T07:25:13Z","updated_at":"2015-09-09T22:56:32Z","closed_at":"2015-09-09T22:56:32Z","body":"Test with the latest 0.17dev \r\n\r\nFollow the example [here] (http://scikit-learn.org/dev/auto_examples/classification/plot_lda.html), but with different size of training data, in my case size of traindata =895x2048   (samples*dim)\r\n\r\n##Error A\r\n\r\n\r\n        lda=LDA(solver='lsqr', shrinkage='auto');\r\n        lda.fit(traindata,trainlabel)\r\n        traindatalda=lda.transform(traindata)\r\n        testdatalda=lda.transform(testdata)\r\n\r\n\r\n\r\nThe following errors are printed:\r\n\r\n  File \"/usr/local/lib/python2.7/dist-packages/sklearn/lda.py\", line 428, in fit\r\n    self._solve_lsqr(X, y, shrinkage=self.shrinkage)\r\n  File \"/usr/local/lib/python2.7/dist-packages/sklearn/lda.py\", line 271, in _solve_lsqr\r\n    self.covariance_ = _class_cov(X, y, self.priors_, shrinkage)\r\n  File \"/usr/local/lib/python2.7/dist-packages/sklearn/lda.py\", line 123, in _class_cov\r\n    covs.append(np.atleast_2d(_cov(Xg, shrinkage)))\r\n  File \"/usr/local/lib/python2.7/dist-packages/sklearn/lda.py\", line 56, in _cov\r\n    s = sc.std_ * ledoit_wolf(X)[0] * sc.std_  # scale back\r\n  File \"/usr/local/lib/python2.7/dist-packages/sklearn/covariance/shrunk_covariance_.py\", line 291, in ledoit_wolf\r\n    \"try increasing block_size\")\r\nMemoryError: LW: n_features is too large, try increasing block_size\r\n\r\n\r\n##Error B\r\n\r\n        lda=LDA(solver='lsqr');\r\n        lda.fit(traindata,trainlabel)\r\n        traindatalda=lda.transform(traindata)\r\n        testdatalda=lda.transform(testdata)\r\n\r\n\r\n  File \"/usr/local/lib/python2.7/dist-packages/sklearn/lda.py\", line 453, in transform\r\n    check_is_fitted(self, ['xbar_', 'scalings_'], all_or_any=any)\r\n  File \"/usr/local/lib/python2.7/dist-packages/sklearn/utils/validation.py\", line 622, in check_is_fitted\r\n    raise NotFittedError(msg % {'name': type(estimator).__name__})\r\nsklearn.utils.validation.NotFittedError: This LDA instance is not fitted yet. Call 'fit' with appropriate arguments before using this method."},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/139066992","html_url":"https://github.com/scikit-learn/scikit-learn/issues/4415#issuecomment-139066992","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4415","id":139066992,"user":{"login":"amueller","id":449558,"avatar_url":"https://avatars.githubusercontent.com/u/449558?v=3","gravatar_id":"","url":"https://api.github.com/users/amueller","html_url":"https://github.com/amueller","followers_url":"https://api.github.com/users/amueller/followers","following_url":"https://api.github.com/users/amueller/following{/other_user}","gists_url":"https://api.github.com/users/amueller/gists{/gist_id}","starred_url":"https://api.github.com/users/amueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amueller/subscriptions","organizations_url":"https://api.github.com/users/amueller/orgs","repos_url":"https://api.github.com/users/amueller/repos","events_url":"https://api.github.com/users/amueller/events{/privacy}","received_events_url":"https://api.github.com/users/amueller/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T22:56:32Z","updated_at":"2015-09-09T22:56:32Z","body":"Fixed via #4427 and #4428. If not, please reopen."}}