{"action":"created","comment":{"url":"https://api.github.com/repos/exploratory-io/exploratory_func/pulls/comments/170809355","pull_request_review_id":99551749,"id":170809355,"diff_hunk":"@@ -740,12 +740,18 @@ exp_balance <- function(df,\n       }\n       else if(is.numeric(df[[col]])) {\n         # for numeric cols, filter NA rows. With NAs, ubSMOTE throws mysterious error like \"invalid 'labels'; length 0 should be 1 or 2\"\n+        # TODO: we should probably warn if more than half of rows are filtered by a column, so that user can remove that column.\n         df <- df %>% dplyr::filter(!is.na(df[[col]]) & !is.infinite(df[[col]]))\n       }\n     }\n     if (nrow(df) == 0) { # if no rows are left, give up smote and return original df.\n       df_balanced <- orig_df # TODO: we should throw error and let user know which columns with NAs to remove.\n     }\n+    else if (n_distinct(df[[target_col]]) != 2) {","path":"R/randomForest_tidiers.R","position":20,"original_position":20,"commit_id":"acf79905523462d4cc72b691ea2948c5e09d9ccc","original_commit_id":"acf79905523462d4cc72b691ea2948c5e09d9ccc","user":{"login":"kei51e","id":68080,"avatar_url":"https://avatars0.githubusercontent.com/u/68080?v=4","gravatar_id":"","url":"https://api.github.com/users/kei51e","html_url":"https://github.com/kei51e","followers_url":"https://api.github.com/users/kei51e/followers","following_url":"https://api.github.com/users/kei51e/following{/other_user}","gists_url":"https://api.github.com/users/kei51e/gists{/gist_id}","starred_url":"https://api.github.com/users/kei51e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kei51e/subscriptions","organizations_url":"https://api.github.com/users/kei51e/orgs","repos_url":"https://api.github.com/users/kei51e/repos","events_url":"https://api.github.com/users/kei51e/events{/privacy}","received_events_url":"https://api.github.com/users/kei51e/received_events","type":"User","site_admin":false},"body":"why it's not \"less than 2\" as mentioned below?","created_at":"2018-02-27T03:54:17Z","updated_at":"2018-02-27T03:54:17Z","html_url":"https://github.com/exploratory-io/exploratory_func/pull/425#discussion_r170809355","pull_request_url":"https://api.github.com/repos/exploratory-io/exploratory_func/pulls/425","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/exploratory-io/exploratory_func/pulls/comments/170809355"},"html":{"href":"https://github.com/exploratory-io/exploratory_func/pull/425#discussion_r170809355"},"pull_request":{"href":"https://api.github.com/repos/exploratory-io/exploratory_func/pulls/425"}}},"pull_request":{"url":"https://api.github.com/repos/exploratory-io/exploratory_func/pulls/425","id":171267930,"html_url":"https://github.com/exploratory-io/exploratory_func/pull/425","diff_url":"https://github.com/exploratory-io/exploratory_func/pull/425.diff","patch_url":"https://github.com/exploratory-io/exploratory_func/pull/425.patch","issue_url":"https://api.github.com/repos/exploratory-io/exploratory_func/issues/425","number":425,"state":"open","locked":false,"title":"exp_balance: Handle the case too much rows are filtered by filtering NA","user":{"login":"hideaki","id":19518,"avatar_url":"https://avatars1.githubusercontent.com/u/19518?v=4","gravatar_id":"","url":"https://api.github.com/users/hideaki","html_url":"https://github.com/hideaki","followers_url":"https://api.github.com/users/hideaki/followers","following_url":"https://api.github.com/users/hideaki/following{/other_user}","gists_url":"https://api.github.com/users/hideaki/gists{/gist_id}","starred_url":"https://api.github.com/users/hideaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hideaki/subscriptions","organizations_url":"https://api.github.com/users/hideaki/orgs","repos_url":"https://api.github.com/users/hideaki/repos","events_url":"https://api.github.com/users/hideaki/events{/privacy}","received_events_url":"https://api.github.com/users/hideaki/received_events","type":"User","site_admin":false},"body":"### Description\r\nHandle the case too much rows are filtered by filtering NA\r\n\r\n### Checklist\r\n\r\nMake sure you have performed following items before submitting this pull request.\r\nIf not, please describe the reason.  \r\n\r\n- [ ] Add test cases for this fix/enhancement\r\n- [ ] Pass devtools::check()\r\n- [x] Pass devtools::test()\r\n- [ ] Test installing from github\r\n- [x] Tested with Exploratory\r\n","created_at":"2018-02-26T02:07:18Z","updated_at":"2018-02-27T03:54:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a4e2ada979a7cde83b3efab15d3c1059676459a","assignee":{"login":"kei51e","id":68080,"avatar_url":"https://avatars0.githubusercontent.com/u/68080?v=4","gravatar_id":"","url":"https://api.github.com/users/kei51e","html_url":"https://github.com/kei51e","followers_url":"https://api.github.com/users/kei51e/followers","following_url":"https://api.github.com/users/kei51e/following{/other_user}","gists_url":"https://api.github.com/users/kei51e/gists{/gist_id}","starred_url":"https://api.github.com/users/kei51e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kei51e/subscriptions","organizations_url":"https://api.github.com/users/kei51e/orgs","repos_url":"https://api.github.com/users/kei51e/repos","events_url":"https://api.github.com/users/kei51e/events{/privacy}","received_events_url":"https://api.github.com/users/kei51e/received_events","type":"User","site_admin":false},"assignees":[{"login":"kei51e","id":68080,"avatar_url":"https://avatars0.githubusercontent.com/u/68080?v=4","gravatar_id":"","url":"https://api.github.com/users/kei51e","html_url":"https://github.com/kei51e","followers_url":"https://api.github.com/users/kei51e/followers","following_url":"https://api.github.com/users/kei51e/following{/other_user}","gists_url":"https://api.github.com/users/kei51e/gists{/gist_id}","starred_url":"https://api.github.com/users/kei51e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kei51e/subscriptions","organizations_url":"https://api.github.com/users/kei51e/orgs","repos_url":"https://api.github.com/users/kei51e/repos","events_url":"https://api.github.com/users/kei51e/events{/privacy}","received_events_url":"https://api.github.com/users/kei51e/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/exploratory-io/exploratory_func/pulls/425/commits","review_comments_url":"https://api.github.com/repos/exploratory-io/exploratory_func/pulls/425/comments","review_comment_url":"https://api.github.com/repos/exploratory-io/exploratory_func/pulls/comments{/number}","comments_url":"https://api.github.com/repos/exploratory-io/exploratory_func/issues/425/comments","statuses_url":"https://api.github.com/repos/exploratory-io/exploratory_func/statuses/acf79905523462d4cc72b691ea2948c5e09d9ccc","head":{"label":"exploratory-io:hideaki_smote_guard","ref":"hideaki_smote_guard","sha":"acf79905523462d4cc72b691ea2948c5e09d9ccc","user":{"login":"exploratory-io","id":17174641,"avatar_url":"https://avatars1.githubusercontent.com/u/17174641?v=4","gravatar_id":"","url":"https://api.github.com/users/exploratory-io","html_url":"https://github.com/exploratory-io","followers_url":"https://api.github.com/users/exploratory-io/followers","following_url":"https://api.github.com/users/exploratory-io/following{/other_user}","gists_url":"https://api.github.com/users/exploratory-io/gists{/gist_id}","starred_url":"https://api.github.com/users/exploratory-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exploratory-io/subscriptions","organizations_url":"https://api.github.com/users/exploratory-io/orgs","repos_url":"https://api.github.com/users/exploratory-io/repos","events_url":"https://api.github.com/users/exploratory-io/events{/privacy}","received_events_url":"https://api.github.com/users/exploratory-io/received_events","type":"Organization","site_admin":false},"repo":{"id":58769613,"name":"exploratory_func","full_name":"exploratory-io/exploratory_func","owner":{"login":"exploratory-io","id":17174641,"avatar_url":"https://avatars1.githubusercontent.com/u/17174641?v=4","gravatar_id":"","url":"https://api.github.com/users/exploratory-io","html_url":"https://github.com/exploratory-io","followers_url":"https://api.github.com/users/exploratory-io/followers","following_url":"https://api.github.com/users/exploratory-io/following{/other_user}","gists_url":"https://api.github.com/users/exploratory-io/gists{/gist_id}","starred_url":"https://api.github.com/users/exploratory-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exploratory-io/subscriptions","organizations_url":"https://api.github.com/users/exploratory-io/orgs","repos_url":"https://api.github.com/users/exploratory-io/repos","events_url":"https://api.github.com/users/exploratory-io/events{/privacy}","received_events_url":"https://api.github.com/users/exploratory-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/exploratory-io/exploratory_func","description":"R functions for Exploratory","fork":false,"url":"https://api.github.com/repos/exploratory-io/exploratory_func","forks_url":"https://api.github.com/repos/exploratory-io/exploratory_func/forks","keys_url":"https://api.github.com/repos/exploratory-io/exploratory_func/keys{/key_id}","collaborators_url":"https://api.github.com/repos/exploratory-io/exploratory_func/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/exploratory-io/exploratory_func/teams","hooks_url":"https://api.github.com/repos/exploratory-io/exploratory_func/hooks","issue_events_url":"https://api.github.com/repos/exploratory-io/exploratory_func/issues/events{/number}","events_url":"https://api.github.com/repos/exploratory-io/exploratory_func/events","assignees_url":"https://api.github.com/repos/exploratory-io/exploratory_func/assignees{/user}","branches_url":"https://api.github.com/repos/exploratory-io/exploratory_func/branches{/branch}","tags_url":"https://api.github.com/repos/exploratory-io/exploratory_func/tags","blobs_url":"https://api.github.com/repos/exploratory-io/exploratory_func/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/exploratory-io/exploratory_func/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/exploratory-io/exploratory_func/git/refs{/sha}","trees_url":"https://api.github.com/repos/exploratory-io/exploratory_func/git/trees{/sha}","statuses_url":"https://api.github.com/repos/exploratory-io/exploratory_func/statuses/{sha}","languages_url":"https://api.github.com/repos/exploratory-io/exploratory_func/languages","stargazers_url":"https://api.github.com/repos/exploratory-io/exploratory_func/stargazers","contributors_url":"https://api.github.com/repos/exploratory-io/exploratory_func/contributors","subscribers_url":"https://api.github.com/repos/exploratory-io/exploratory_func/subscribers","subscription_url":"https://api.github.com/repos/exploratory-io/exploratory_func/subscription","commits_url":"https://api.github.com/repos/exploratory-io/exploratory_func/commits{/sha}","git_commits_url":"https://api.github.com/repos/exploratory-io/exploratory_func/git/commits{/sha}","comments_url":"https://api.github.com/repos/exploratory-io/exploratory_func/comments{/number}","issue_comment_url":"https://api.github.com/repos/exploratory-io/exploratory_func/issues/comments{/number}","contents_url":"https://api.github.com/repos/exploratory-io/exploratory_func/contents/{+path}","compare_url":"https://api.github.com/repos/exploratory-io/exploratory_func/compare/{base}...{head}","merges_url":"https://api.github.com/repos/exploratory-io/exploratory_func/merges","archive_url":"https://api.github.com/repos/exploratory-io/exploratory_func/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/exploratory-io/exploratory_func/downloads","issues_url":"https://api.github.com/repos/exploratory-io/exploratory_func/issues{/number}","pulls_url":"https://api.github.com/repos/exploratory-io/exploratory_func/pulls{/number}","milestones_url":"https://api.github.com/repos/exploratory-io/exploratory_func/milestones{/number}","notifications_url":"https://api.github.com/repos/exploratory-io/exploratory_func/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/exploratory-io/exploratory_func/labels{/name}","releases_url":"https://api.github.com/repos/exploratory-io/exploratory_func/releases{/id}","deployments_url":"https://api.github.com/repos/exploratory-io/exploratory_func/deployments","created_at":"2016-05-13T20:14:49Z","updated_at":"2018-01-09T03:16:34Z","pushed_at":"2018-02-26T02:07:18Z","git_url":"git://github.com/exploratory-io/exploratory_func.git","ssh_url":"git@github.com:exploratory-io/exploratory_func.git","clone_url":"https://github.com/exploratory-io/exploratory_func.git","svn_url":"https://github.com/exploratory-io/exploratory_func","homepage":null,"size":2102,"stargazers_count":33,"watchers_count":33,"language":"R","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":5,"open_issues":8,"watchers":33,"default_branch":"master"}},"base":{"label":"exploratory-io:master","ref":"master","sha":"567546b1aded066d6c18b6758143e66e0cb34207","user":{"login":"exploratory-io","id":17174641,"avatar_url":"https://avatars1.githubusercontent.com/u/17174641?v=4","gravatar_id":"","url":"https://api.github.com/users/exploratory-io","html_url":"https://github.com/exploratory-io","followers_url":"https://api.github.com/users/exploratory-io/followers","following_url":"https://api.github.com/users/exploratory-io/following{/other_user}","gists_url":"https://api.github.com/users/exploratory-io/gists{/gist_id}","starred_url":"https://api.github.com/users/exploratory-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exploratory-io/subscriptions","organizations_url":"https://api.github.com/users/exploratory-io/orgs","repos_url":"https://api.github.com/users/exploratory-io/repos","events_url":"https://api.github.com/users/exploratory-io/events{/privacy}","received_events_url":"https://api.github.com/users/exploratory-io/received_events","type":"Organization","site_admin":false},"repo":{"id":58769613,"name":"exploratory_func","full_name":"exploratory-io/exploratory_func","owner":{"login":"exploratory-io","id":17174641,"avatar_url":"https://avatars1.githubusercontent.com/u/17174641?v=4","gravatar_id":"","url":"https://api.github.com/users/exploratory-io","html_url":"https://github.com/exploratory-io","followers_url":"https://api.github.com/users/exploratory-io/followers","following_url":"https://api.github.com/users/exploratory-io/following{/other_user}","gists_url":"https://api.github.com/users/exploratory-io/gists{/gist_id}","starred_url":"https://api.github.com/users/exploratory-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exploratory-io/subscriptions","organizations_url":"https://api.github.com/users/exploratory-io/orgs","repos_url":"https://api.github.com/users/exploratory-io/repos","events_url":"https://api.github.com/users/exploratory-io/events{/privacy}","received_events_url":"https://api.github.com/users/exploratory-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/exploratory-io/exploratory_func","description":"R functions for Exploratory","fork":false,"url":"https://api.github.com/repos/exploratory-io/exploratory_func","forks_url":"https://api.github.com/repos/exploratory-io/exploratory_func/forks","keys_url":"https://api.github.com/repos/exploratory-io/exploratory_func/keys{/key_id}","collaborators_url":"https://api.github.com/repos/exploratory-io/exploratory_func/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/exploratory-io/exploratory_func/teams","hooks_url":"https://api.github.com/repos/exploratory-io/exploratory_func/hooks","issue_events_url":"https://api.github.com/repos/exploratory-io/exploratory_func/issues/events{/number}","events_url":"https://api.github.com/repos/exploratory-io/exploratory_func/events","assignees_url":"https://api.github.com/repos/exploratory-io/exploratory_func/assignees{/user}","branches_url":"https://api.github.com/repos/exploratory-io/exploratory_func/branches{/branch}","tags_url":"https://api.github.com/repos/exploratory-io/exploratory_func/tags","blobs_url":"https://api.github.com/repos/exploratory-io/exploratory_func/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/exploratory-io/exploratory_func/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/exploratory-io/exploratory_func/git/refs{/sha}","trees_url":"https://api.github.com/repos/exploratory-io/exploratory_func/git/trees{/sha}","statuses_url":"https://api.github.com/repos/exploratory-io/exploratory_func/statuses/{sha}","languages_url":"https://api.github.com/repos/exploratory-io/exploratory_func/languages","stargazers_url":"https://api.github.com/repos/exploratory-io/exploratory_func/stargazers","contributors_url":"https://api.github.com/repos/exploratory-io/exploratory_func/contributors","subscribers_url":"https://api.github.com/repos/exploratory-io/exploratory_func/subscribers","subscription_url":"https://api.github.com/repos/exploratory-io/exploratory_func/subscription","commits_url":"https://api.github.com/repos/exploratory-io/exploratory_func/commits{/sha}","git_commits_url":"https://api.github.com/repos/exploratory-io/exploratory_func/git/commits{/sha}","comments_url":"https://api.github.com/repos/exploratory-io/exploratory_func/comments{/number}","issue_comment_url":"https://api.github.com/repos/exploratory-io/exploratory_func/issues/comments{/number}","contents_url":"https://api.github.com/repos/exploratory-io/exploratory_func/contents/{+path}","compare_url":"https://api.github.com/repos/exploratory-io/exploratory_func/compare/{base}...{head}","merges_url":"https://api.github.com/repos/exploratory-io/exploratory_func/merges","archive_url":"https://api.github.com/repos/exploratory-io/exploratory_func/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/exploratory-io/exploratory_func/downloads","issues_url":"https://api.github.com/repos/exploratory-io/exploratory_func/issues{/number}","pulls_url":"https://api.github.com/repos/exploratory-io/exploratory_func/pulls{/number}","milestones_url":"https://api.github.com/repos/exploratory-io/exploratory_func/milestones{/number}","notifications_url":"https://api.github.com/repos/exploratory-io/exploratory_func/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/exploratory-io/exploratory_func/labels{/name}","releases_url":"https://api.github.com/repos/exploratory-io/exploratory_func/releases{/id}","deployments_url":"https://api.github.com/repos/exploratory-io/exploratory_func/deployments","created_at":"2016-05-13T20:14:49Z","updated_at":"2018-01-09T03:16:34Z","pushed_at":"2018-02-26T02:07:18Z","git_url":"git://github.com/exploratory-io/exploratory_func.git","ssh_url":"git@github.com:exploratory-io/exploratory_func.git","clone_url":"https://github.com/exploratory-io/exploratory_func.git","svn_url":"https://github.com/exploratory-io/exploratory_func","homepage":null,"size":2102,"stargazers_count":33,"watchers_count":33,"language":"R","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":5,"open_issues":8,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/exploratory-io/exploratory_func/pulls/425"},"html":{"href":"https://github.com/exploratory-io/exploratory_func/pull/425"},"issue":{"href":"https://api.github.com/repos/exploratory-io/exploratory_func/issues/425"},"comments":{"href":"https://api.github.com/repos/exploratory-io/exploratory_func/issues/425/comments"},"review_comments":{"href":"https://api.github.com/repos/exploratory-io/exploratory_func/pulls/425/comments"},"review_comment":{"href":"https://api.github.com/repos/exploratory-io/exploratory_func/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/exploratory-io/exploratory_func/pulls/425/commits"},"statuses":{"href":"https://api.github.com/repos/exploratory-io/exploratory_func/statuses/acf79905523462d4cc72b691ea2948c5e09d9ccc"}},"author_association":"OWNER"}}
{"actor":{"display_login":"kei51e"}}