{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/74245769","id":74245769,"diff_hunk":"@@ -0,0 +1,235 @@\n+# Author : Raghav RV <rvraghav93@gmail.com>\n+#\n+# Licence : BSD 3 clause\n+\n+import numpy as np\n+\n+from ..utils import check_X_y\n+from ..utils import check_random_state\n+from ..utils.multiclass import type_of_target\n+\n+\n+__all__ = [\"drop_values\"]\n+\n+\n+def drop_values(X, y=None,\n+                missing_values=\"NaN\",\n+                drop_fraction=0.1,\n+                label_correlation=1.0,\n+                correlated_labels=1,\n+                return_correlated_labels=False,\n+                copy=False,\n+                random_state=None):\n+    \"\"\"Drop values based on a preset strategy.\n+\n+    Attributes\n+    ----------\n+\n+    X : ndarray like of shape (n_features, n_samples)\n+        Data, in which the values must be dropped and set to\n+        ``missing_values``.\n+\n+    y : ndarray like of shape (n_samples,), optional\n+        Target, in a supervised classification task.\n+\n+        It can also be used for regression targets if the ``label_correlation``\n+        is 0. (MCAR missingness).\n+\n+    missing_values : {\"NaN\" (or np.nan) | int}, default \"NaN\"\n+        The value to insert to indicate missingness.\n+\n+    drop_fraction : float in range [0, 1], default 0.1\n+        The fraction of values that should be dropped.","path":"sklearn/datasets/value_dropper.py","position":42,"original_position":42,"commit_id":"00fc2f6165f35aa0a7cd9441ccb59951c12f9eea","original_commit_id":"00fc2f6165f35aa0a7cd9441ccb59951c12f9eea","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":"This description appears to be outdated. As does the parameter name: now we're talking about the target proportion missing in the entire dataset.\r\n\r\nI'll admit that with repeated runs with different correlated labels, this interpretation of the parameter might be a bit confusing: the user might thing that specifying `correlated_labels` means the `missing_fraction` only pertains to that portion of the data.\r\n\r\nI'm not altogether sure that my suggestion of this being an overall target missing quantity was a good one.","created_at":"2016-08-10T13:42:20Z","updated_at":"2016-08-10T13:42:20Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/7084#discussion_r74245769","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/7084","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/74245769"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/7084#discussion_r74245769"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/7084"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/7084","id":78865546,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/7084","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/7084.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/7084.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/7084","number":7084,"state":"open","locked":false,"title":"[MRG] ENH add a value_dropper to artificially add missing_values to dataset","user":{"login":"raghavrv","id":9487348,"avatar_url":"https://avatars.githubusercontent.com/u/9487348?v=3","gravatar_id":"","url":"https://api.github.com/users/raghavrv","html_url":"https://github.com/raghavrv","followers_url":"https://api.github.com/users/raghavrv/followers","following_url":"https://api.github.com/users/raghavrv/following{/other_user}","gists_url":"https://api.github.com/users/raghavrv/gists{/gist_id}","starred_url":"https://api.github.com/users/raghavrv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raghavrv/subscriptions","organizations_url":"https://api.github.com/users/raghavrv/orgs","repos_url":"https://api.github.com/users/raghavrv/repos","events_url":"https://api.github.com/users/raghavrv/events{/privacy}","received_events_url":"https://api.github.com/users/raghavrv/received_events","type":"User","site_admin":false},"body":"Fixes #6284 \r\n\r\n`value_dropper` function has a `label_correlation` attribute which will control the extent to which missingness will correlate with the (given) `labels`.\r\n\r\n- [x] `value_dropper` to introduce missing values.\r\n- [x] Simplify and cleanup.\r\n- [x] Add example.\r\n- [x] Tests/doc\r\n\r\nI'd add an example for #5974 which will use this function to compare the missing value handling strategy for MCAR/MNAR missingness. \r\n\r\n@agramfort @GaelVaroquaux @amueller @jnothman @glouppe @MechCoder ","created_at":"2016-07-26T14:49:38Z","updated_at":"2016-08-10T13:42:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"004404d6374af163610da00f8cc72e66b3fb04c8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/7084/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/7084/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/7084/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/00fc2f6165f35aa0a7cd9441ccb59951c12f9eea","head":{"label":"raghavrv:value_dropper","ref":"value_dropper","sha":"00fc2f6165f35aa0a7cd9441ccb59951c12f9eea","user":{"login":"raghavrv","id":9487348,"avatar_url":"https://avatars.githubusercontent.com/u/9487348?v=3","gravatar_id":"","url":"https://api.github.com/users/raghavrv","html_url":"https://github.com/raghavrv","followers_url":"https://api.github.com/users/raghavrv/followers","following_url":"https://api.github.com/users/raghavrv/following{/other_user}","gists_url":"https://api.github.com/users/raghavrv/gists{/gist_id}","starred_url":"https://api.github.com/users/raghavrv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raghavrv/subscriptions","organizations_url":"https://api.github.com/users/raghavrv/orgs","repos_url":"https://api.github.com/users/raghavrv/repos","events_url":"https://api.github.com/users/raghavrv/events{/privacy}","received_events_url":"https://api.github.com/users/raghavrv/received_events","type":"User","site_admin":false},"repo":{"id":26038110,"name":"scikit-learn","full_name":"raghavrv/scikit-learn","owner":{"login":"raghavrv","id":9487348,"avatar_url":"https://avatars.githubusercontent.com/u/9487348?v=3","gravatar_id":"","url":"https://api.github.com/users/raghavrv","html_url":"https://github.com/raghavrv","followers_url":"https://api.github.com/users/raghavrv/followers","following_url":"https://api.github.com/users/raghavrv/following{/other_user}","gists_url":"https://api.github.com/users/raghavrv/gists{/gist_id}","starred_url":"https://api.github.com/users/raghavrv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raghavrv/subscriptions","organizations_url":"https://api.github.com/users/raghavrv/orgs","repos_url":"https://api.github.com/users/raghavrv/repos","events_url":"https://api.github.com/users/raghavrv/events{/privacy}","received_events_url":"https://api.github.com/users/raghavrv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/raghavrv/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/raghavrv/scikit-learn","forks_url":"https://api.github.com/repos/raghavrv/scikit-learn/forks","keys_url":"https://api.github.com/repos/raghavrv/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/raghavrv/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/raghavrv/scikit-learn/teams","hooks_url":"https://api.github.com/repos/raghavrv/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/raghavrv/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/raghavrv/scikit-learn/events","assignees_url":"https://api.github.com/repos/raghavrv/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/raghavrv/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/raghavrv/scikit-learn/tags","blobs_url":"https://api.github.com/repos/raghavrv/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/raghavrv/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/raghavrv/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/raghavrv/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/raghavrv/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/raghavrv/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/raghavrv/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/raghavrv/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/raghavrv/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/raghavrv/scikit-learn/subscription","commits_url":"https://api.github.com/repos/raghavrv/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/raghavrv/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/raghavrv/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/raghavrv/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/raghavrv/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/raghavrv/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/raghavrv/scikit-learn/merges","archive_url":"https://api.github.com/repos/raghavrv/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/raghavrv/scikit-learn/downloads","issues_url":"https://api.github.com/repos/raghavrv/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/raghavrv/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/raghavrv/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/raghavrv/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/raghavrv/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/raghavrv/scikit-learn/releases{/id}","deployments_url":"https://api.github.com/repos/raghavrv/scikit-learn/deployments","created_at":"2014-11-01T00:56:31Z","updated_at":"2016-04-27T18:29:41Z","pushed_at":"2016-08-10T13:15:53Z","git_url":"git://github.com/raghavrv/scikit-learn.git","ssh_url":"git@github.com:raghavrv/scikit-learn.git","clone_url":"https://github.com/raghavrv/scikit-learn.git","svn_url":"https://github.com/raghavrv/scikit-learn","homepage":"http://scikit-learn.org","size":90474,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"scikit-learn:master","ref":"master","sha":"c99aadad1e87208ce9d8d1214205ecd5a8e46d87","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-08-10T13:42:08Z","pushed_at":"2016-08-10T13:41:21Z","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":121219,"stargazers_count":12769,"watchers_count":12769,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7392,"mirror_url":null,"open_issues_count":1256,"forks":7392,"open_issues":1256,"watchers":12769,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/7084"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/7084"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/7084"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/7084/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/7084/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/7084/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/00fc2f6165f35aa0a7cd9441ccb59951c12f9eea"}}}}
{"actor":{"display_login":"jnothman"}}