{"action":"created","comment":{"url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/pulls/comments/91105800","pull_request_review_id":11614395,"id":91105800,"diff_hunk":"@@ -19,14 +28,45 @@ def select_incomplete_data(self, data):\n         data = data_splitting.remove_non_numeric_columns(data)\n         return data_filler.drop_complete_data_rows(data)\n \n-    def select_missing_column(self, data):\n-        print data\n+    def select_missing_columns(self, data):\n+        training_columns = []\n+        target_columns = []\n+\n+        for col in data:\n+            if data[col].isnull().sum(0) > 0:\n+                target_columns.append(col)\n+            else:\n+                training_columns.append(col)\n+\n+        return training_columns, target_columns\n+\n+    def apply_filler(self, x_train, y_train, x_test):\n+        model = xgboost.XGBRegressor()\n+        model = model.fit(x_train, y_train)\n+        return model.predict(x_test)\n+\n+    def fill_missing(self, y_test, results, data, target_col):\n+        for value in range(0, y_test.shape[0]):\n+            if str(y_test.iloc[value].values[0]) == \"nan\":\n+                row = y_test.iloc[value].name\n+                value = results[int(y_test.iloc[value].name)]\n+                data.set_value(row, target_col, value)\n+\n+        return data\n+\n+    def fill_missing_columns(self, data, complete_data):\n+        training_columns, target_columns = self.select_missing_columns(data)\n+\n+        for target_col in target_columns:\n+            x_train, y_train = data_splitting.separate_target(complete_data, target_col)\n+            x_test, y_test = data_splitting.separate_target(data, target_col)\n+            results = self.apply_filler(x_train, y_train, x_test)\n+            data = self.fill_missing(y_test, results, data, target_col)\n \n-    def train_filler(self):\n-        return\n+        return data\n \n-    def fill_missing(self):\n-        return\n+    def get_filled_data(self):","path":"modules/DMZ/data_kit/filler_regression.py","position":77,"original_position":77,"commit_id":"5d9cee8281785169db333f680ed407b6c96c4137","original_commit_id":"5d9cee8281785169db333f680ed407b6c96c4137","user":{"login":"asclines","id":4149872,"avatar_url":"https://avatars.githubusercontent.com/u/4149872?v=3","gravatar_id":"","url":"https://api.github.com/users/asclines","html_url":"https://github.com/asclines","followers_url":"https://api.github.com/users/asclines/followers","following_url":"https://api.github.com/users/asclines/following{/other_user}","gists_url":"https://api.github.com/users/asclines/gists{/gist_id}","starred_url":"https://api.github.com/users/asclines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asclines/subscriptions","organizations_url":"https://api.github.com/users/asclines/orgs","repos_url":"https://api.github.com/users/asclines/repos","events_url":"https://api.github.com/users/asclines/events{/privacy}","received_events_url":"https://api.github.com/users/asclines/received_events","type":"User","site_admin":false},"body":"Why is this here? This seems very anti-Python-ey","created_at":"2016-12-06T15:50:15Z","updated_at":"2016-12-06T15:51:30Z","html_url":"https://github.com/ASAAR/SE2-KaggleComp/pull/144#discussion_r91105800","pull_request_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/pulls/144","_links":{"self":{"href":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/pulls/comments/91105800"},"html":{"href":"https://github.com/ASAAR/SE2-KaggleComp/pull/144#discussion_r91105800"},"pull_request":{"href":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/pulls/144"}}},"pull_request":{"url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/pulls/144","id":96446365,"html_url":"https://github.com/ASAAR/SE2-KaggleComp/pull/144","diff_url":"https://github.com/ASAAR/SE2-KaggleComp/pull/144.diff","patch_url":"https://github.com/ASAAR/SE2-KaggleComp/pull/144.patch","issue_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/issues/144","number":144,"state":"open","locked":false,"title":"Machine Learning Driven Filling","user":{"login":"ASAAR","id":1311843,"avatar_url":"https://avatars.githubusercontent.com/u/1311843?v=3","gravatar_id":"","url":"https://api.github.com/users/ASAAR","html_url":"https://github.com/ASAAR","followers_url":"https://api.github.com/users/ASAAR/followers","following_url":"https://api.github.com/users/ASAAR/following{/other_user}","gists_url":"https://api.github.com/users/ASAAR/gists{/gist_id}","starred_url":"https://api.github.com/users/ASAAR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ASAAR/subscriptions","organizations_url":"https://api.github.com/users/ASAAR/orgs","repos_url":"https://api.github.com/users/ASAAR/repos","events_url":"https://api.github.com/users/ASAAR/events{/privacy}","received_events_url":"https://api.github.com/users/ASAAR/received_events","type":"User","site_admin":false},"body":"closes #139 \r\n\r\nIncludes,\r\n- A XGBoost based regression filler for missing data.\r\n- Inclusion of XGBoost in the framework\r\n- Replacement of launcher.py with simple call to hub.py\r\n\r\nCaveat: I have temporarily removed the FillerStrategy from the worker. I'll be refactoring that some, with the goal of consolidating the two filling methods.","created_at":"2016-12-04T21:00:29Z","updated_at":"2016-12-06T15:51:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"004cbbff6ebe1b87816a26f841cc097f628921bb","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/milestones/4","html_url":"https://github.com/ASAAR/SE2-KaggleComp/milestones/Iteration%204","labels_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/milestones/4/labels","id":2110766,"number":4,"title":"Iteration 4","description":"This is the final iteration for SE2, however the project will continue.","creator":{"login":"ASAAR","id":1311843,"avatar_url":"https://avatars.githubusercontent.com/u/1311843?v=3","gravatar_id":"","url":"https://api.github.com/users/ASAAR","html_url":"https://github.com/ASAAR","followers_url":"https://api.github.com/users/ASAAR/followers","following_url":"https://api.github.com/users/ASAAR/following{/other_user}","gists_url":"https://api.github.com/users/ASAAR/gists{/gist_id}","starred_url":"https://api.github.com/users/ASAAR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ASAAR/subscriptions","organizations_url":"https://api.github.com/users/ASAAR/orgs","repos_url":"https://api.github.com/users/ASAAR/repos","events_url":"https://api.github.com/users/ASAAR/events{/privacy}","received_events_url":"https://api.github.com/users/ASAAR/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":3,"state":"open","created_at":"2016-11-02T21:19:17Z","updated_at":"2016-12-06T15:42:41Z","due_on":"2016-12-12T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/pulls/144/commits","review_comments_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/pulls/144/comments","review_comment_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/issues/144/comments","statuses_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/statuses/5d9cee8281785169db333f680ed407b6c96c4137","head":{"label":"ASAAR:isaac/redesign","ref":"isaac/redesign","sha":"5d9cee8281785169db333f680ed407b6c96c4137","user":{"login":"ASAAR","id":1311843,"avatar_url":"https://avatars.githubusercontent.com/u/1311843?v=3","gravatar_id":"","url":"https://api.github.com/users/ASAAR","html_url":"https://github.com/ASAAR","followers_url":"https://api.github.com/users/ASAAR/followers","following_url":"https://api.github.com/users/ASAAR/following{/other_user}","gists_url":"https://api.github.com/users/ASAAR/gists{/gist_id}","starred_url":"https://api.github.com/users/ASAAR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ASAAR/subscriptions","organizations_url":"https://api.github.com/users/ASAAR/orgs","repos_url":"https://api.github.com/users/ASAAR/repos","events_url":"https://api.github.com/users/ASAAR/events{/privacy}","received_events_url":"https://api.github.com/users/ASAAR/received_events","type":"User","site_admin":false},"repo":{"id":67246967,"name":"SE2-KaggleComp","full_name":"ASAAR/SE2-KaggleComp","owner":{"login":"ASAAR","id":1311843,"avatar_url":"https://avatars.githubusercontent.com/u/1311843?v=3","gravatar_id":"","url":"https://api.github.com/users/ASAAR","html_url":"https://github.com/ASAAR","followers_url":"https://api.github.com/users/ASAAR/followers","following_url":"https://api.github.com/users/ASAAR/following{/other_user}","gists_url":"https://api.github.com/users/ASAAR/gists{/gist_id}","starred_url":"https://api.github.com/users/ASAAR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ASAAR/subscriptions","organizations_url":"https://api.github.com/users/ASAAR/orgs","repos_url":"https://api.github.com/users/ASAAR/repos","events_url":"https://api.github.com/users/ASAAR/events{/privacy}","received_events_url":"https://api.github.com/users/ASAAR/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ASAAR/SE2-KaggleComp","description":"Software Engineering 2 class, we're making a framework to apply machine learning algorithms and automate the process of finding the right algorithm for the job.","fork":false,"url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp","forks_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/forks","keys_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/teams","hooks_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/hooks","issue_events_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/issues/events{/number}","events_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/events","assignees_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/assignees{/user}","branches_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/branches{/branch}","tags_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/tags","blobs_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/git/refs{/sha}","trees_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/statuses/{sha}","languages_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/languages","stargazers_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/stargazers","contributors_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/contributors","subscribers_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/subscribers","subscription_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/subscription","commits_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/commits{/sha}","git_commits_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/git/commits{/sha}","comments_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/comments{/number}","issue_comment_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/issues/comments{/number}","contents_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/contents/{+path}","compare_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/merges","archive_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/downloads","issues_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/issues{/number}","pulls_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/pulls{/number}","milestones_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/milestones{/number}","notifications_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/labels{/name}","releases_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/releases{/id}","deployments_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/deployments","created_at":"2016-09-02T18:47:39Z","updated_at":"2016-10-31T22:10:40Z","pushed_at":"2016-12-04T23:35:19Z","git_url":"git://github.com/ASAAR/SE2-KaggleComp.git","ssh_url":"git@github.com:ASAAR/SE2-KaggleComp.git","clone_url":"https://github.com/ASAAR/SE2-KaggleComp.git","svn_url":"https://github.com/ASAAR/SE2-KaggleComp","homepage":"","size":6070,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":18,"forks":0,"open_issues":18,"watchers":5,"default_branch":"master"}},"base":{"label":"ASAAR:master","ref":"master","sha":"7436f8360c9b76ac78decc2482df97cb41b6f038","user":{"login":"ASAAR","id":1311843,"avatar_url":"https://avatars.githubusercontent.com/u/1311843?v=3","gravatar_id":"","url":"https://api.github.com/users/ASAAR","html_url":"https://github.com/ASAAR","followers_url":"https://api.github.com/users/ASAAR/followers","following_url":"https://api.github.com/users/ASAAR/following{/other_user}","gists_url":"https://api.github.com/users/ASAAR/gists{/gist_id}","starred_url":"https://api.github.com/users/ASAAR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ASAAR/subscriptions","organizations_url":"https://api.github.com/users/ASAAR/orgs","repos_url":"https://api.github.com/users/ASAAR/repos","events_url":"https://api.github.com/users/ASAAR/events{/privacy}","received_events_url":"https://api.github.com/users/ASAAR/received_events","type":"User","site_admin":false},"repo":{"id":67246967,"name":"SE2-KaggleComp","full_name":"ASAAR/SE2-KaggleComp","owner":{"login":"ASAAR","id":1311843,"avatar_url":"https://avatars.githubusercontent.com/u/1311843?v=3","gravatar_id":"","url":"https://api.github.com/users/ASAAR","html_url":"https://github.com/ASAAR","followers_url":"https://api.github.com/users/ASAAR/followers","following_url":"https://api.github.com/users/ASAAR/following{/other_user}","gists_url":"https://api.github.com/users/ASAAR/gists{/gist_id}","starred_url":"https://api.github.com/users/ASAAR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ASAAR/subscriptions","organizations_url":"https://api.github.com/users/ASAAR/orgs","repos_url":"https://api.github.com/users/ASAAR/repos","events_url":"https://api.github.com/users/ASAAR/events{/privacy}","received_events_url":"https://api.github.com/users/ASAAR/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ASAAR/SE2-KaggleComp","description":"Software Engineering 2 class, we're making a framework to apply machine learning algorithms and automate the process of finding the right algorithm for the job.","fork":false,"url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp","forks_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/forks","keys_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/teams","hooks_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/hooks","issue_events_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/issues/events{/number}","events_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/events","assignees_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/assignees{/user}","branches_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/branches{/branch}","tags_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/tags","blobs_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/git/refs{/sha}","trees_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/statuses/{sha}","languages_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/languages","stargazers_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/stargazers","contributors_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/contributors","subscribers_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/subscribers","subscription_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/subscription","commits_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/commits{/sha}","git_commits_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/git/commits{/sha}","comments_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/comments{/number}","issue_comment_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/issues/comments{/number}","contents_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/contents/{+path}","compare_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/merges","archive_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/downloads","issues_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/issues{/number}","pulls_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/pulls{/number}","milestones_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/milestones{/number}","notifications_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/labels{/name}","releases_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/releases{/id}","deployments_url":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/deployments","created_at":"2016-09-02T18:47:39Z","updated_at":"2016-10-31T22:10:40Z","pushed_at":"2016-12-04T23:35:19Z","git_url":"git://github.com/ASAAR/SE2-KaggleComp.git","ssh_url":"git@github.com:ASAAR/SE2-KaggleComp.git","clone_url":"https://github.com/ASAAR/SE2-KaggleComp.git","svn_url":"https://github.com/ASAAR/SE2-KaggleComp","homepage":"","size":6070,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":18,"forks":0,"open_issues":18,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/pulls/144"},"html":{"href":"https://github.com/ASAAR/SE2-KaggleComp/pull/144"},"issue":{"href":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/issues/144"},"comments":{"href":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/issues/144/comments"},"review_comments":{"href":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/pulls/144/comments"},"review_comment":{"href":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/pulls/144/commits"},"statuses":{"href":"https://api.github.com/repos/ASAAR/SE2-KaggleComp/statuses/5d9cee8281785169db333f680ed407b6c96c4137"}}}}
{"actor":{"display_login":"asclines"}}