{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/58808018","id":58808018,"diff_hunk":"@@ -357,6 +379,18 @@ def transform(self, X):\n \n             X.data[mask] = astype(valid_statistics[indexes], X.dtype,\n                                   copy=False)\n+\n+            if self.add_missing_indicator:\n+                mask_matrix = X.__class__((mask, X.indices.copy(),\n+                                           X.indptr.copy()), shape=X.shape, dtype=X.dtype)\n+                mask_matrix.eliminate_zeros()  # removes explicit False entries to make the matrix sparser\n+                features_with_missing_values = np.where(sparse_min_max(mask_matrix, 0)[1])[0]","path":"sklearn/preprocessing/imputation.py","position":91,"original_position":91,"commit_id":"03fe617bbba37d91df30d25afc6c473206ec4628","original_commit_id":"03fe617bbba37d91df30d25afc6c473206ec4628","user":{"login":"jnothman","id":78827,"avatar_url":"https://avatars.githubusercontent.com/u/78827?v=3","gravatar_id":"","url":"https://api.github.com/users/jnothman","html_url":"https://github.com/jnothman","followers_url":"https://api.github.com/users/jnothman/followers","following_url":"https://api.github.com/users/jnothman/following{/other_user}","gists_url":"https://api.github.com/users/jnothman/gists{/gist_id}","starred_url":"https://api.github.com/users/jnothman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnothman/subscriptions","organizations_url":"https://api.github.com/users/jnothman/orgs","repos_url":"https://api.github.com/users/jnothman/repos","events_url":"https://api.github.com/users/jnothman/events{/privacy}","received_events_url":"https://api.github.com/users/jnothman/received_events","type":"User","site_admin":false},"body":"Ah, I see the `.toarray().ravel()`. That's right, then.","created_at":"2016-04-07T01:30:19Z","updated_at":"2016-04-07T01:30:19Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/6607#discussion_r58808018","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6607","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/58808018"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/6607#discussion_r58808018"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6607"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6607","id":64668962,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/6607","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/6607.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/6607.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6607","number":6607,"state":"open","locked":false,"title":"[MRG] Add add_missing_indicator option to show missing values in the output","user":{"login":"maniteja123","id":6291963,"avatar_url":"https://avatars.githubusercontent.com/u/6291963?v=3","gravatar_id":"","url":"https://api.github.com/users/maniteja123","html_url":"https://github.com/maniteja123","followers_url":"https://api.github.com/users/maniteja123/followers","following_url":"https://api.github.com/users/maniteja123/following{/other_user}","gists_url":"https://api.github.com/users/maniteja123/gists{/gist_id}","starred_url":"https://api.github.com/users/maniteja123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maniteja123/subscriptions","organizations_url":"https://api.github.com/users/maniteja123/orgs","repos_url":"https://api.github.com/users/maniteja123/repos","events_url":"https://api.github.com/users/maniteja123/events{/privacy}","received_events_url":"https://api.github.com/users/maniteja123/received_events","type":"User","site_admin":false},"body":"Initial attempt to provide an option to indicate imputed features in the transformed output as suggested in #6556 . I have added an option to ``fit_transform`` to provide backward compatibility and not break the code.\r\n\r\nAt present, the indicator feature is only for dense matrices and it is a simple approach. Any feedback is appreciated here. Thanks.","created_at":"2016-03-30T17:51:44Z","updated_at":"2016-04-07T01:30:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bac0456de58692ed14cb89b3b54516786edfae1b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6607/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6607/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/6607/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/03fe617bbba37d91df30d25afc6c473206ec4628","head":{"label":"maniteja123:imputer_indicator","ref":"imputer_indicator","sha":"03fe617bbba37d91df30d25afc6c473206ec4628","user":{"login":"maniteja123","id":6291963,"avatar_url":"https://avatars.githubusercontent.com/u/6291963?v=3","gravatar_id":"","url":"https://api.github.com/users/maniteja123","html_url":"https://github.com/maniteja123","followers_url":"https://api.github.com/users/maniteja123/followers","following_url":"https://api.github.com/users/maniteja123/following{/other_user}","gists_url":"https://api.github.com/users/maniteja123/gists{/gist_id}","starred_url":"https://api.github.com/users/maniteja123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maniteja123/subscriptions","organizations_url":"https://api.github.com/users/maniteja123/orgs","repos_url":"https://api.github.com/users/maniteja123/repos","events_url":"https://api.github.com/users/maniteja123/events{/privacy}","received_events_url":"https://api.github.com/users/maniteja123/received_events","type":"User","site_admin":false},"repo":{"id":25398323,"name":"scikit-learn","full_name":"maniteja123/scikit-learn","owner":{"login":"maniteja123","id":6291963,"avatar_url":"https://avatars.githubusercontent.com/u/6291963?v=3","gravatar_id":"","url":"https://api.github.com/users/maniteja123","html_url":"https://github.com/maniteja123","followers_url":"https://api.github.com/users/maniteja123/followers","following_url":"https://api.github.com/users/maniteja123/following{/other_user}","gists_url":"https://api.github.com/users/maniteja123/gists{/gist_id}","starred_url":"https://api.github.com/users/maniteja123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maniteja123/subscriptions","organizations_url":"https://api.github.com/users/maniteja123/orgs","repos_url":"https://api.github.com/users/maniteja123/repos","events_url":"https://api.github.com/users/maniteja123/events{/privacy}","received_events_url":"https://api.github.com/users/maniteja123/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maniteja123/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/maniteja123/scikit-learn","forks_url":"https://api.github.com/repos/maniteja123/scikit-learn/forks","keys_url":"https://api.github.com/repos/maniteja123/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maniteja123/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maniteja123/scikit-learn/teams","hooks_url":"https://api.github.com/repos/maniteja123/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/maniteja123/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/maniteja123/scikit-learn/events","assignees_url":"https://api.github.com/repos/maniteja123/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/maniteja123/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/maniteja123/scikit-learn/tags","blobs_url":"https://api.github.com/repos/maniteja123/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maniteja123/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maniteja123/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/maniteja123/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maniteja123/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/maniteja123/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/maniteja123/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/maniteja123/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/maniteja123/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/maniteja123/scikit-learn/subscription","commits_url":"https://api.github.com/repos/maniteja123/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/maniteja123/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/maniteja123/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/maniteja123/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/maniteja123/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/maniteja123/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maniteja123/scikit-learn/merges","archive_url":"https://api.github.com/repos/maniteja123/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maniteja123/scikit-learn/downloads","issues_url":"https://api.github.com/repos/maniteja123/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/maniteja123/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/maniteja123/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/maniteja123/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maniteja123/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/maniteja123/scikit-learn/releases{/id}","deployments_url":"https://api.github.com/repos/maniteja123/scikit-learn/deployments","created_at":"2014-10-18T13:39:05Z","updated_at":"2016-01-15T07:58:12Z","pushed_at":"2016-04-06T15:28:41Z","git_url":"git://github.com/maniteja123/scikit-learn.git","ssh_url":"git@github.com:maniteja123/scikit-learn.git","clone_url":"https://github.com/maniteja123/scikit-learn.git","svn_url":"https://github.com/maniteja123/scikit-learn","homepage":"http://scikit-learn.org","size":68313,"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":"589fcadbb74a0eb261f6ff740e6d068b3b214265","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}","deployments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/deployments","created_at":"2010-08-17T09:43:38Z","updated_at":"2016-04-07T00:36:54Z","pushed_at":"2016-04-06T21:04:52Z","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":103851,"stargazers_count":10590,"watchers_count":10590,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6166,"mirror_url":null,"open_issues_count":1145,"forks":6166,"open_issues":1145,"watchers":10590,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6607"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/6607"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6607"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6607/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6607/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/6607/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/03fe617bbba37d91df30d25afc6c473206ec4628"}}}}