{"action":"created","issue":{"url":"https://api.github.com/repos/bhmm/bhmm/issues/36","repository_url":"https://api.github.com/repos/bhmm/bhmm","labels_url":"https://api.github.com/repos/bhmm/bhmm/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/bhmm/bhmm/issues/36/comments","events_url":"https://api.github.com/repos/bhmm/bhmm/issues/36/events","html_url":"https://github.com/bhmm/bhmm/issues/36","id":138374448,"number":36,"title":"HMM initialization is broken","user":{"login":"anntzer","id":1322974,"avatar_url":"https://avatars.githubusercontent.com/u/1322974?v=3","gravatar_id":"","url":"https://api.github.com/users/anntzer","html_url":"https://github.com/anntzer","followers_url":"https://api.github.com/users/anntzer/followers","following_url":"https://api.github.com/users/anntzer/following{/other_user}","gists_url":"https://api.github.com/users/anntzer/gists{/gist_id}","starred_url":"https://api.github.com/users/anntzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anntzer/subscriptions","organizations_url":"https://api.github.com/users/anntzer/orgs","repos_url":"https://api.github.com/users/anntzer/repos","events_url":"https://api.github.com/users/anntzer/events{/privacy}","received_events_url":"https://api.github.com/users/anntzer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-04T04:24:25Z","updated_at":"2016-03-04T07:36:11Z","closed_at":null,"body":"from the current master:\r\n```\r\nIn [10]: estimate_hmm([np.r_[np.random.randn(10) + 10, np.random.randn(10) + 11]], 2)\r\n<... elided>\r\n/usr/lib/python3.5/site-packages/msmtools/estimation/api.py in transition_matrix(C, reversible, mu, method, **kwargs)\r\n    939         if mu is None:\r\n    940             if sparse_computation:\r\n--> 941                 T = sparse.mle_trev.mle_trev(C, **kwargs)\r\n    942             else:\r\n    943                 T = dense.mle_trev.mle_trev(C, **kwargs)\r\n\r\nmsmtools/estimation/sparse/mle_trev.pyx in msmtools.estimation.sparse.mle_trev.mle_trev (msmtools/estimation/sparse/mle_trev.c:1645)()\r\n\r\nAssertionError: C must be strongly connected\r\n```\r\nTurns out the shipped version of sklearn.mixture.GMM fits very poorly this mixture of a gaussian of mean 10 and a gaussian of mean 11, returning instead\r\n```\r\nipdb> p gmm.means_\r\narray([[ 10.30914931],\r\n       [  0.        ]])\r\n```\r\n\r\nSwitching to the latest version of scikit-learn solves the issue.  Any reason you don't want to simply rely on it as a dependency?"},"comment":{"url":"https://api.github.com/repos/bhmm/bhmm/issues/comments/192162794","html_url":"https://github.com/bhmm/bhmm/issues/36#issuecomment-192162794","issue_url":"https://api.github.com/repos/bhmm/bhmm/issues/36","id":192162794,"user":{"login":"franknoe","id":6495810,"avatar_url":"https://avatars.githubusercontent.com/u/6495810?v=3","gravatar_id":"","url":"https://api.github.com/users/franknoe","html_url":"https://github.com/franknoe","followers_url":"https://api.github.com/users/franknoe/followers","following_url":"https://api.github.com/users/franknoe/following{/other_user}","gists_url":"https://api.github.com/users/franknoe/gists{/gist_id}","starred_url":"https://api.github.com/users/franknoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franknoe/subscriptions","organizations_url":"https://api.github.com/users/franknoe/orgs","repos_url":"https://api.github.com/users/franknoe/repos","events_url":"https://api.github.com/users/franknoe/events{/privacy}","received_events_url":"https://api.github.com/users/franknoe/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T07:36:11Z","updated_at":"2016-03-04T07:36:11Z","body":"@marscher and @clonker, can you check the k-means implementation \nintegrated in bhmm with this example and compare with the one that \nsklearns to initialize GMMs? I think the problem might be that we get an \nempty cluster in this case.\n\nThe reason we don't want to create a dependency on sklearn is that we \nwould only need it for this simple functionality and bhmm is a core \npackage. That doesn't justify creating a dependency on a huge package. \nNote that we have also changed the GMM code to employ a different \n(faster) k-means implementation. bhmm is in a pre-release state, so I'm \nconfident we can resolve these hickups before a stable release.\n\nAm 04/03/16 um 05:24 schrieb Antony Lee:\n>\n> from the current master:\n>\n> |In [10]: estimate_hmm([np.r_[np.random.randn(10) + 10, \n> np.random.randn(10) + 11]], 2) <... elided> \n> /usr/lib/python3.5/site-packages/msmtools/estimation/api.py in \n> transition_matrix(C, reversible, mu, method, **kwargs) 939 if mu is \n> None: 940 if sparse_computation: --> 941 T = \n> sparse.mle_trev.mle_trev(C, **kwargs) 942 else: 943 T = \n> dense.mle_trev.mle_trev(C, **kwargs) \n> msmtools/estimation/sparse/mle_trev.pyx in \n> msmtools.estimation.sparse.mle_trev.mle_trev \n> (msmtools/estimation/sparse/mle_trev.c:1645)() AssertionError: C must \n> be strongly connected |\n>\n> Turns out the shipped version of sklearn.mixture.GMM fits very poorly \n> this mixture of a gaussian of mean 10 and a gaussian of mean 11, \n> returning instead\n>\n> |ipdb> p gmm.means_ array([[ 10.30914931], [ 0. ]]) |\n>\n> Switching to the latest version of scikit-learn solves the issue. Any \n> reason you don't want to simply rely on it as a dependency?\n>\n> —\n> Reply to this email directly or view it on GitHub \n> <https://github.com/bhmm/bhmm/issues/36>.\n>\n\n\n-- \n\n----------------------------------------------\nProf. Dr. Frank Noe\nHead of Computational Molecular Biology group\nFreie Universitaet Berlin\n\nPhone: (+49) (0)30 838 75354\nWeb:   research.franknoe.de\nMail:  Arnimallee 6, 14195 Berlin, Germany\n----------------------------------------------\n\n"}}