{"action":"created","issue":{"url":"https://api.github.com/repos/piskvorky/gensim/issues/494","labels_url":"https://api.github.com/repos/piskvorky/gensim/issues/494/labels{/name}","comments_url":"https://api.github.com/repos/piskvorky/gensim/issues/494/comments","events_url":"https://api.github.com/repos/piskvorky/gensim/issues/494/events","html_url":"https://github.com/piskvorky/gensim/issues/494","id":112347291,"number":494,"title":"LDAModel DepracationWarning under Python 3","user":{"login":"mattilyra","id":1055719,"avatar_url":"https://avatars.githubusercontent.com/u/1055719?v=3","gravatar_id":"","url":"https://api.github.com/users/mattilyra","html_url":"https://github.com/mattilyra","followers_url":"https://api.github.com/users/mattilyra/followers","following_url":"https://api.github.com/users/mattilyra/following{/other_user}","gists_url":"https://api.github.com/users/mattilyra/gists{/gist_id}","starred_url":"https://api.github.com/users/mattilyra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattilyra/subscriptions","organizations_url":"https://api.github.com/users/mattilyra/orgs","repos_url":"https://api.github.com/users/mattilyra/repos","events_url":"https://api.github.com/users/mattilyra/events{/privacy}","received_events_url":"https://api.github.com/users/mattilyra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-20T11:31:33Z","updated_at":"2015-10-20T11:40:11Z","closed_at":null,"body":"I noticed that when training an LDA model under Python 3 with NumPy 1.10 or 1.9 I get a long long list of `DepracationWarning`s from NumPy, so much so that it kills the browser running a notebook. This doesn't happen under Py2 with NumPy 1.10.\r\n\r\nI think it's because the `ids` is a list not a `ndarray`. The warning refers to two lines in `ldamodel.py`\r\n\r\n- https://github.com/piskvorky/gensim/blob/develop/gensim/models/ldamodel.py#L375\r\n- https://github.com/piskvorky/gensim/blob/develop/gensim/models/ldamodel.py#L401\r\n\r\nBoth use the `ids` list to index a `ndarray`. The `ids` are just feature ids from the current document (?) so I tried a quick fix of just changing the `ids` to `ndarray` which makes the warnings go away, but I haven't tested if it has some other consquences, I don't see why it would.\r\n\r\nThe `DepracationWarning`s (just two of them, there are many more actually produced)\r\n\r\n    /Volumes/LocalDataHD/conda/envs/py34/lib/python3.4/site-packages/gensim/models/ldamodel.py:375: DeprecationWarning: non integer (and non boolean) array-likes will not be accepted as indices in the future\r\n      expElogbetad = self.expElogbeta[:, ids]\r\n    /Volumes/LocalDataHD/conda/envs/py34/lib/python3.4/site-packages/gensim/models/ldamodel.py:401: DeprecationWarning: non integer (and non boolean) array-likes will not be accepted as indices in the future\r\n      sstats[:, ids] += numpy.outer(expElogthetad.T, cts / phinorm)"},"comment":{"url":"https://api.github.com/repos/piskvorky/gensim/issues/comments/149535201","html_url":"https://github.com/piskvorky/gensim/issues/494#issuecomment-149535201","issue_url":"https://api.github.com/repos/piskvorky/gensim/issues/494","id":149535201,"user":{"login":"piskvorky","id":610412,"avatar_url":"https://avatars.githubusercontent.com/u/610412?v=3","gravatar_id":"","url":"https://api.github.com/users/piskvorky","html_url":"https://github.com/piskvorky","followers_url":"https://api.github.com/users/piskvorky/followers","following_url":"https://api.github.com/users/piskvorky/following{/other_user}","gists_url":"https://api.github.com/users/piskvorky/gists{/gist_id}","starred_url":"https://api.github.com/users/piskvorky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piskvorky/subscriptions","organizations_url":"https://api.github.com/users/piskvorky/orgs","repos_url":"https://api.github.com/users/piskvorky/repos","events_url":"https://api.github.com/users/piskvorky/events{/privacy}","received_events_url":"https://api.github.com/users/piskvorky/received_events","type":"User","site_admin":false},"created_at":"2015-10-20T11:40:10Z","updated_at":"2015-10-20T11:40:10Z","body":"I think this may be related to this discussion: https://github.com/piskvorky/gensim/pull/448#issuecomment-139839622\r\n\r\nYes, we definitely want to get rid of these warnings!"}}