{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/28379165","id":28379165,"diff_hunk":"@@ -411,7 +411,30 @@ def sample(self, n_samples=1, random_state=None):\n                     num_comp_in_X, random_state=random_state).T\n         return X\n \n-    def fit(self, X, y=None):\n+    def fit_predict(self, X, y=None):\n+        \"\"\"\n+        Fit and then predict labels for data.\n+        Warning: due to the final maximization step in the EM algorithm,\n+        with low iterations the prediction may not be 100% accurate\n+\n+        Parameters\n+        ----------\n+        X : array-like, shape = [n_samples, n_features]\n+\n+        Returns\n+        -------\n+        C : array, shape = (n_samples,)\n+        \"\"\"\n+\n+        responsibilities = self._fit(X, y)\n+        if responsibilities is None:\n+            prediction = None","path":"sklearn/mixture/gmm.py","position":22,"original_position":22,"commit_id":"18d4df42a66eb75cc917978f120ebdfa5ef7d1b1","original_commit_id":"18d4df42a66eb75cc917978f120ebdfa5ef7d1b1","user":{"login":"ogrisel","id":89061,"avatar_url":"https://avatars.githubusercontent.com/u/89061?v=3","gravatar_id":"","url":"https://api.github.com/users/ogrisel","html_url":"https://github.com/ogrisel","followers_url":"https://api.github.com/users/ogrisel/followers","following_url":"https://api.github.com/users/ogrisel/following{/other_user}","gists_url":"https://api.github.com/users/ogrisel/gists{/gist_id}","starred_url":"https://api.github.com/users/ogrisel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogrisel/subscriptions","organizations_url":"https://api.github.com/users/ogrisel/orgs","repos_url":"https://api.github.com/users/ogrisel/repos","events_url":"https://api.github.com/users/ogrisel/events{/privacy}","received_events_url":"https://api.github.com/users/ogrisel/received_events","type":"User","site_admin":false},"body":"How could that ever happen?","created_at":"2015-04-14T22:52:09Z","updated_at":"2015-04-14T22:52:09Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/4593#discussion_r28379165","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4593","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/28379165"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/4593#discussion_r28379165"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4593"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4593","id":33296226,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/4593","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/4593.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/4593.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4593","number":4593,"state":"open","locked":false,"title":"Adding a fit_predict method for the GMM","user":{"login":"clorenz7","id":1377586,"avatar_url":"https://avatars.githubusercontent.com/u/1377586?v=3","gravatar_id":"","url":"https://api.github.com/users/clorenz7","html_url":"https://github.com/clorenz7","followers_url":"https://api.github.com/users/clorenz7/followers","following_url":"https://api.github.com/users/clorenz7/following{/other_user}","gists_url":"https://api.github.com/users/clorenz7/gists{/gist_id}","starred_url":"https://api.github.com/users/clorenz7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clorenz7/subscriptions","organizations_url":"https://api.github.com/users/clorenz7/orgs","repos_url":"https://api.github.com/users/clorenz7/repos","events_url":"https://api.github.com/users/clorenz7/events{/privacy}","received_events_url":"https://api.github.com/users/clorenz7/received_events","type":"User","site_admin":false},"body":"With low iterations, the prediction might not be 100% accurate due to\r\nthe final maximization step in the EM algorithm.\r\n\r\nSee issue:\r\nhttps://github.com/scikit-learn/scikit-learn/issues/4579","created_at":"2015-04-14T20:26:27Z","updated_at":"2015-04-14T22:52:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c60919aee441373d1b3dfd9ec6ca6e17013ea753","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4593/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4593/comments","review_comment_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4593/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/18d4df42a66eb75cc917978f120ebdfa5ef7d1b1","head":{"label":"clorenz7:gmm_fit_predict","ref":"gmm_fit_predict","sha":"18d4df42a66eb75cc917978f120ebdfa5ef7d1b1","user":{"login":"clorenz7","id":1377586,"avatar_url":"https://avatars.githubusercontent.com/u/1377586?v=3","gravatar_id":"","url":"https://api.github.com/users/clorenz7","html_url":"https://github.com/clorenz7","followers_url":"https://api.github.com/users/clorenz7/followers","following_url":"https://api.github.com/users/clorenz7/following{/other_user}","gists_url":"https://api.github.com/users/clorenz7/gists{/gist_id}","starred_url":"https://api.github.com/users/clorenz7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clorenz7/subscriptions","organizations_url":"https://api.github.com/users/clorenz7/orgs","repos_url":"https://api.github.com/users/clorenz7/repos","events_url":"https://api.github.com/users/clorenz7/events{/privacy}","received_events_url":"https://api.github.com/users/clorenz7/received_events","type":"User","site_admin":false},"repo":{"id":33944783,"name":"scikit-learn","full_name":"clorenz7/scikit-learn","owner":{"login":"clorenz7","id":1377586,"avatar_url":"https://avatars.githubusercontent.com/u/1377586?v=3","gravatar_id":"","url":"https://api.github.com/users/clorenz7","html_url":"https://github.com/clorenz7","followers_url":"https://api.github.com/users/clorenz7/followers","following_url":"https://api.github.com/users/clorenz7/following{/other_user}","gists_url":"https://api.github.com/users/clorenz7/gists{/gist_id}","starred_url":"https://api.github.com/users/clorenz7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clorenz7/subscriptions","organizations_url":"https://api.github.com/users/clorenz7/orgs","repos_url":"https://api.github.com/users/clorenz7/repos","events_url":"https://api.github.com/users/clorenz7/events{/privacy}","received_events_url":"https://api.github.com/users/clorenz7/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/clorenz7/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/clorenz7/scikit-learn","forks_url":"https://api.github.com/repos/clorenz7/scikit-learn/forks","keys_url":"https://api.github.com/repos/clorenz7/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clorenz7/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clorenz7/scikit-learn/teams","hooks_url":"https://api.github.com/repos/clorenz7/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/clorenz7/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/clorenz7/scikit-learn/events","assignees_url":"https://api.github.com/repos/clorenz7/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/clorenz7/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/clorenz7/scikit-learn/tags","blobs_url":"https://api.github.com/repos/clorenz7/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clorenz7/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clorenz7/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/clorenz7/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clorenz7/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/clorenz7/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/clorenz7/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/clorenz7/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/clorenz7/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/clorenz7/scikit-learn/subscription","commits_url":"https://api.github.com/repos/clorenz7/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/clorenz7/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/clorenz7/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/clorenz7/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/clorenz7/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/clorenz7/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clorenz7/scikit-learn/merges","archive_url":"https://api.github.com/repos/clorenz7/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clorenz7/scikit-learn/downloads","issues_url":"https://api.github.com/repos/clorenz7/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/clorenz7/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/clorenz7/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/clorenz7/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clorenz7/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/clorenz7/scikit-learn/releases{/id}","created_at":"2015-04-14T16:54:29Z","updated_at":"2015-04-14T16:54:35Z","pushed_at":"2015-04-14T21:14:43Z","git_url":"git://github.com/clorenz7/scikit-learn.git","ssh_url":"git@github.com:clorenz7/scikit-learn.git","clone_url":"https://github.com/clorenz7/scikit-learn.git","svn_url":"https://github.com/clorenz7/scikit-learn","homepage":"http://scikit-learn.org","size":60890,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scikit-learn:master","ref":"master","sha":"cb219b425019a9086f6585222990980ed449249b","user":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-learn","html_url":"https://github.com/scikit-learn","followers_url":"https://api.github.com/users/scikit-learn/followers","following_url":"https://api.github.com/users/scikit-learn/following{/other_user}","gists_url":"https://api.github.com/users/scikit-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-learn/subscriptions","organizations_url":"https://api.github.com/users/scikit-learn/orgs","repos_url":"https://api.github.com/users/scikit-learn/repos","events_url":"https://api.github.com/users/scikit-learn/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-learn/received_events","type":"Organization","site_admin":false},"repo":{"id":843222,"name":"scikit-learn","full_name":"scikit-learn/scikit-learn","owner":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-learn","html_url":"https://github.com/scikit-learn","followers_url":"https://api.github.com/users/scikit-learn/followers","following_url":"https://api.github.com/users/scikit-learn/following{/other_user}","gists_url":"https://api.github.com/users/scikit-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-learn/subscriptions","organizations_url":"https://api.github.com/users/scikit-learn/orgs","repos_url":"https://api.github.com/users/scikit-learn/repos","events_url":"https://api.github.com/users/scikit-learn/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-learn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scikit-learn/scikit-learn","description":"scikit-learn: machine learning in Python","fork":false,"url":"https://api.github.com/repos/scikit-learn/scikit-learn","forks_url":"https://api.github.com/repos/scikit-learn/scikit-learn/forks","keys_url":"https://api.github.com/repos/scikit-learn/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scikit-learn/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scikit-learn/scikit-learn/teams","hooks_url":"https://api.github.com/repos/scikit-learn/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/events","assignees_url":"https://api.github.com/repos/scikit-learn/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/scikit-learn/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/scikit-learn/scikit-learn/tags","blobs_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/scikit-learn/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/scikit-learn/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/scikit-learn/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/scikit-learn/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/scikit-learn/scikit-learn/subscription","commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/scikit-learn/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/scikit-learn/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scikit-learn/scikit-learn/merges","archive_url":"https://api.github.com/repos/scikit-learn/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scikit-learn/scikit-learn/downloads","issues_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/scikit-learn/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/scikit-learn/scikit-learn/releases{/id}","created_at":"2010-08-17T09:43:38Z","updated_at":"2015-04-14T22:34:58Z","pushed_at":"2015-04-14T21:20:26Z","git_url":"git://github.com/scikit-learn/scikit-learn.git","ssh_url":"git@github.com:scikit-learn/scikit-learn.git","clone_url":"https://github.com/scikit-learn/scikit-learn.git","svn_url":"https://github.com/scikit-learn/scikit-learn","homepage":"http://scikit-learn.org","size":121481,"stargazers_count":5611,"watchers_count":5611,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3360,"mirror_url":null,"open_issues_count":638,"forks":3360,"open_issues":638,"watchers":5611,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4593"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/4593"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4593"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4593/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4593/comments"},"review_comment":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4593/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/18d4df42a66eb75cc917978f120ebdfa5ef7d1b1"}}}}