{"action":"created","comment":{"url":"https://api.github.com/repos/rhiever/tpot/pulls/comments/80940672","pull_request_review_id":1957865,"id":80940672,"diff_hunk":"@@ -209,18 +209,24 @@ def process_operator(operator, depth=0):\n             steps.extend(process_operator(input_name, depth + 1))\n \n         # If the step is an estimator and is not the last step then we must\n-        # add its guess as a synthetic feature\n-        if tpot_op.root and depth > 0:\n-            steps.append(\n-                \"make_union(VotingClassifier([(\\\"est\\\", {})]), FunctionTransformer(lambda X: X))\".\n-                format(tpot_op.export(*args))\n-            )\n+        # add its class probabilities and class prodictions as synthetic features and only for classifier\n+        if tpot_op.root  and depth > 0:\n+            # only for classifier unless will casue error when using regressor\n+            if tpot_op.classification:\n+                step = \"make_union(make_pipeline(VotingClassifier([(\\\"est_prob\\\", {})], voting = \\\"soft\\\"), \".format(tpot_op.export(*args))\n+                step += \"FunctionTransformer(lambda X: X[0], validate=False)), \"\n+                step += \"VotingClassifier([(\\\"est_class\\\", {})], voting = \\\"hard\\\")\".format(tpot_op.export(*args))\n+                step += \", FunctionTransformer(lambda X: X))\"","path":"tpot/export_utils.py","position":17,"original_position":17,"commit_id":"9cc709a62e4ce3f6bd5e1fcdb7029daf1f1026f2","original_commit_id":"9cc709a62e4ce3f6bd5e1fcdb7029daf1f1026f2","user":{"login":"teaearlgraycold","id":3281507,"avatar_url":"https://avatars.githubusercontent.com/u/3281507?v=3","gravatar_id":"","url":"https://api.github.com/users/teaearlgraycold","html_url":"https://github.com/teaearlgraycold","followers_url":"https://api.github.com/users/teaearlgraycold/followers","following_url":"https://api.github.com/users/teaearlgraycold/following{/other_user}","gists_url":"https://api.github.com/users/teaearlgraycold/gists{/gist_id}","starred_url":"https://api.github.com/users/teaearlgraycold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teaearlgraycold/subscriptions","organizations_url":"https://api.github.com/users/teaearlgraycold/orgs","repos_url":"https://api.github.com/users/teaearlgraycold/repos","events_url":"https://api.github.com/users/teaearlgraycold/events{/privacy}","received_events_url":"https://api.github.com/users/teaearlgraycold/received_events","type":"User","site_admin":false},"body":"Should probably just use a multi-line string here.\r\n\r\n```Python\r\nstep = (\"make_union(\"\r\n\"    make_pipeline(\"\r\n\"        VotingClassifier([(\"est_prob\", {OP_CODE})], voting=\"soft\"),\"\r\n\"        FunctionTransformer(lambda X: X[0], validate=False)\"\r\n\"    ),\"\r\n\"    VotingClassifier([(\"est_class\", {OP_CODE})], voting=\"hard\"),\"\r\n\"    FunctionTransformer(lambda X: X)\"\r\n\")\").format(OP_CODE=tpot_op.export(*args))\r\n```","created_at":"2016-09-28T15:10:06Z","updated_at":"2016-09-28T15:10:07Z","html_url":"https://github.com/rhiever/tpot/pull/278#discussion_r80940672","pull_request_url":"https://api.github.com/repos/rhiever/tpot/pulls/278","_links":{"self":{"href":"https://api.github.com/repos/rhiever/tpot/pulls/comments/80940672"},"html":{"href":"https://github.com/rhiever/tpot/pull/278#discussion_r80940672"},"pull_request":{"href":"https://api.github.com/repos/rhiever/tpot/pulls/278"}}},"pull_request":{"url":"https://api.github.com/repos/rhiever/tpot/pulls/278","id":87137795,"html_url":"https://github.com/rhiever/tpot/pull/278","diff_url":"https://github.com/rhiever/tpot/pull/278.diff","patch_url":"https://github.com/rhiever/tpot/pull/278.patch","issue_url":"https://api.github.com/repos/rhiever/tpot/issues/278","number":278,"state":"open","locked":false,"title":"Add two synthetic features: class predictions and class probabilities into classifcation operators","user":{"login":"weixuanfu2016","id":21084970,"avatar_url":"https://avatars.githubusercontent.com/u/21084970?v=3","gravatar_id":"","url":"https://api.github.com/users/weixuanfu2016","html_url":"https://github.com/weixuanfu2016","followers_url":"https://api.github.com/users/weixuanfu2016/followers","following_url":"https://api.github.com/users/weixuanfu2016/following{/other_user}","gists_url":"https://api.github.com/users/weixuanfu2016/gists{/gist_id}","starred_url":"https://api.github.com/users/weixuanfu2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weixuanfu2016/subscriptions","organizations_url":"https://api.github.com/users/weixuanfu2016/orgs","repos_url":"https://api.github.com/users/weixuanfu2016/repos","events_url":"https://api.github.com/users/weixuanfu2016/events{/privacy}","received_events_url":"https://api.github.com/users/weixuanfu2016/received_events","type":"User","site_admin":false},"body":"[please review the [contribution guidelines](http://rhiever.github.io/tpot/contributing/) prior to submitting your pull request. go ahead and delete this line if you've already reviewed said guidelines.]\r\n\r\n## What does this PR do?\r\n\r\nAdd two synthetic features: class predictions and class probabilities into classifcation operators\r\n\r\n## Where should the reviewer start?\r\n\r\nLine 214 in export_utils.py\r\n\r\n## How should this PR be tested?\r\n\r\n MNIST example\r\n\r\n## Any background context you want to provide?\r\n\r\n\r\n\r\n## What are the relevant issues?\r\n\r\n#214 \r\n\r\n\r\n## Questions:\r\n\r\n@teaearlgraycold : The old synthetic feature (only adding class predictions) can work for both classifier and regressor. I kept it for regressor. But I am not sure whether it is reasonable put regressor into VotingClassifier. Will it output predicted (expected) values to next regressor in a pipeline? \r\n\r\n","created_at":"2016-09-28T15:00:09Z","updated_at":"2016-09-28T15:10:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a6181b48d67fa37c3c01e9651daa1e1922d29bea","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rhiever/tpot/pulls/278/commits","review_comments_url":"https://api.github.com/repos/rhiever/tpot/pulls/278/comments","review_comment_url":"https://api.github.com/repos/rhiever/tpot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rhiever/tpot/issues/278/comments","statuses_url":"https://api.github.com/repos/rhiever/tpot/statuses/9cc709a62e4ce3f6bd5e1fcdb7029daf1f1026f2","head":{"label":"weixuanfu2016:class_prob","ref":"class_prob","sha":"9cc709a62e4ce3f6bd5e1fcdb7029daf1f1026f2","user":{"login":"weixuanfu2016","id":21084970,"avatar_url":"https://avatars.githubusercontent.com/u/21084970?v=3","gravatar_id":"","url":"https://api.github.com/users/weixuanfu2016","html_url":"https://github.com/weixuanfu2016","followers_url":"https://api.github.com/users/weixuanfu2016/followers","following_url":"https://api.github.com/users/weixuanfu2016/following{/other_user}","gists_url":"https://api.github.com/users/weixuanfu2016/gists{/gist_id}","starred_url":"https://api.github.com/users/weixuanfu2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weixuanfu2016/subscriptions","organizations_url":"https://api.github.com/users/weixuanfu2016/orgs","repos_url":"https://api.github.com/users/weixuanfu2016/repos","events_url":"https://api.github.com/users/weixuanfu2016/events{/privacy}","received_events_url":"https://api.github.com/users/weixuanfu2016/received_events","type":"User","site_admin":false},"repo":{"id":66400718,"name":"tpot","full_name":"weixuanfu2016/tpot","owner":{"login":"weixuanfu2016","id":21084970,"avatar_url":"https://avatars.githubusercontent.com/u/21084970?v=3","gravatar_id":"","url":"https://api.github.com/users/weixuanfu2016","html_url":"https://github.com/weixuanfu2016","followers_url":"https://api.github.com/users/weixuanfu2016/followers","following_url":"https://api.github.com/users/weixuanfu2016/following{/other_user}","gists_url":"https://api.github.com/users/weixuanfu2016/gists{/gist_id}","starred_url":"https://api.github.com/users/weixuanfu2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weixuanfu2016/subscriptions","organizations_url":"https://api.github.com/users/weixuanfu2016/orgs","repos_url":"https://api.github.com/users/weixuanfu2016/repos","events_url":"https://api.github.com/users/weixuanfu2016/events{/privacy}","received_events_url":"https://api.github.com/users/weixuanfu2016/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/weixuanfu2016/tpot","description":"A Python tool that automatically creates and optimizes machine learning pipelines using genetic programming.","fork":true,"url":"https://api.github.com/repos/weixuanfu2016/tpot","forks_url":"https://api.github.com/repos/weixuanfu2016/tpot/forks","keys_url":"https://api.github.com/repos/weixuanfu2016/tpot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weixuanfu2016/tpot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weixuanfu2016/tpot/teams","hooks_url":"https://api.github.com/repos/weixuanfu2016/tpot/hooks","issue_events_url":"https://api.github.com/repos/weixuanfu2016/tpot/issues/events{/number}","events_url":"https://api.github.com/repos/weixuanfu2016/tpot/events","assignees_url":"https://api.github.com/repos/weixuanfu2016/tpot/assignees{/user}","branches_url":"https://api.github.com/repos/weixuanfu2016/tpot/branches{/branch}","tags_url":"https://api.github.com/repos/weixuanfu2016/tpot/tags","blobs_url":"https://api.github.com/repos/weixuanfu2016/tpot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weixuanfu2016/tpot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weixuanfu2016/tpot/git/refs{/sha}","trees_url":"https://api.github.com/repos/weixuanfu2016/tpot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weixuanfu2016/tpot/statuses/{sha}","languages_url":"https://api.github.com/repos/weixuanfu2016/tpot/languages","stargazers_url":"https://api.github.com/repos/weixuanfu2016/tpot/stargazers","contributors_url":"https://api.github.com/repos/weixuanfu2016/tpot/contributors","subscribers_url":"https://api.github.com/repos/weixuanfu2016/tpot/subscribers","subscription_url":"https://api.github.com/repos/weixuanfu2016/tpot/subscription","commits_url":"https://api.github.com/repos/weixuanfu2016/tpot/commits{/sha}","git_commits_url":"https://api.github.com/repos/weixuanfu2016/tpot/git/commits{/sha}","comments_url":"https://api.github.com/repos/weixuanfu2016/tpot/comments{/number}","issue_comment_url":"https://api.github.com/repos/weixuanfu2016/tpot/issues/comments{/number}","contents_url":"https://api.github.com/repos/weixuanfu2016/tpot/contents/{+path}","compare_url":"https://api.github.com/repos/weixuanfu2016/tpot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weixuanfu2016/tpot/merges","archive_url":"https://api.github.com/repos/weixuanfu2016/tpot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weixuanfu2016/tpot/downloads","issues_url":"https://api.github.com/repos/weixuanfu2016/tpot/issues{/number}","pulls_url":"https://api.github.com/repos/weixuanfu2016/tpot/pulls{/number}","milestones_url":"https://api.github.com/repos/weixuanfu2016/tpot/milestones{/number}","notifications_url":"https://api.github.com/repos/weixuanfu2016/tpot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weixuanfu2016/tpot/labels{/name}","releases_url":"https://api.github.com/repos/weixuanfu2016/tpot/releases{/id}","deployments_url":"https://api.github.com/repos/weixuanfu2016/tpot/deployments","created_at":"2016-08-23T20:27:09Z","updated_at":"2016-08-23T20:27:11Z","pushed_at":"2016-09-28T14:48:21Z","git_url":"git://github.com/weixuanfu2016/tpot.git","ssh_url":"git@github.com:weixuanfu2016/tpot.git","clone_url":"https://github.com/weixuanfu2016/tpot.git","svn_url":"https://github.com/weixuanfu2016/tpot","homepage":"http://rhiever.github.io/tpot/","size":4595,"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":"rhiever:master","ref":"master","sha":"3b915ba6121cfb3b09305068af64441cdf8631e7","user":{"login":"rhiever","id":1719223,"avatar_url":"https://avatars.githubusercontent.com/u/1719223?v=3","gravatar_id":"","url":"https://api.github.com/users/rhiever","html_url":"https://github.com/rhiever","followers_url":"https://api.github.com/users/rhiever/followers","following_url":"https://api.github.com/users/rhiever/following{/other_user}","gists_url":"https://api.github.com/users/rhiever/gists{/gist_id}","starred_url":"https://api.github.com/users/rhiever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhiever/subscriptions","organizations_url":"https://api.github.com/users/rhiever/orgs","repos_url":"https://api.github.com/users/rhiever/repos","events_url":"https://api.github.com/users/rhiever/events{/privacy}","received_events_url":"https://api.github.com/users/rhiever/received_events","type":"User","site_admin":false},"repo":{"id":45495679,"name":"tpot","full_name":"rhiever/tpot","owner":{"login":"rhiever","id":1719223,"avatar_url":"https://avatars.githubusercontent.com/u/1719223?v=3","gravatar_id":"","url":"https://api.github.com/users/rhiever","html_url":"https://github.com/rhiever","followers_url":"https://api.github.com/users/rhiever/followers","following_url":"https://api.github.com/users/rhiever/following{/other_user}","gists_url":"https://api.github.com/users/rhiever/gists{/gist_id}","starred_url":"https://api.github.com/users/rhiever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhiever/subscriptions","organizations_url":"https://api.github.com/users/rhiever/orgs","repos_url":"https://api.github.com/users/rhiever/repos","events_url":"https://api.github.com/users/rhiever/events{/privacy}","received_events_url":"https://api.github.com/users/rhiever/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rhiever/tpot","description":"A Python tool that automatically creates and optimizes machine learning pipelines using genetic programming.","fork":false,"url":"https://api.github.com/repos/rhiever/tpot","forks_url":"https://api.github.com/repos/rhiever/tpot/forks","keys_url":"https://api.github.com/repos/rhiever/tpot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rhiever/tpot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rhiever/tpot/teams","hooks_url":"https://api.github.com/repos/rhiever/tpot/hooks","issue_events_url":"https://api.github.com/repos/rhiever/tpot/issues/events{/number}","events_url":"https://api.github.com/repos/rhiever/tpot/events","assignees_url":"https://api.github.com/repos/rhiever/tpot/assignees{/user}","branches_url":"https://api.github.com/repos/rhiever/tpot/branches{/branch}","tags_url":"https://api.github.com/repos/rhiever/tpot/tags","blobs_url":"https://api.github.com/repos/rhiever/tpot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rhiever/tpot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rhiever/tpot/git/refs{/sha}","trees_url":"https://api.github.com/repos/rhiever/tpot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rhiever/tpot/statuses/{sha}","languages_url":"https://api.github.com/repos/rhiever/tpot/languages","stargazers_url":"https://api.github.com/repos/rhiever/tpot/stargazers","contributors_url":"https://api.github.com/repos/rhiever/tpot/contributors","subscribers_url":"https://api.github.com/repos/rhiever/tpot/subscribers","subscription_url":"https://api.github.com/repos/rhiever/tpot/subscription","commits_url":"https://api.github.com/repos/rhiever/tpot/commits{/sha}","git_commits_url":"https://api.github.com/repos/rhiever/tpot/git/commits{/sha}","comments_url":"https://api.github.com/repos/rhiever/tpot/comments{/number}","issue_comment_url":"https://api.github.com/repos/rhiever/tpot/issues/comments{/number}","contents_url":"https://api.github.com/repos/rhiever/tpot/contents/{+path}","compare_url":"https://api.github.com/repos/rhiever/tpot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rhiever/tpot/merges","archive_url":"https://api.github.com/repos/rhiever/tpot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rhiever/tpot/downloads","issues_url":"https://api.github.com/repos/rhiever/tpot/issues{/number}","pulls_url":"https://api.github.com/repos/rhiever/tpot/pulls{/number}","milestones_url":"https://api.github.com/repos/rhiever/tpot/milestones{/number}","notifications_url":"https://api.github.com/repos/rhiever/tpot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rhiever/tpot/labels{/name}","releases_url":"https://api.github.com/repos/rhiever/tpot/releases{/id}","deployments_url":"https://api.github.com/repos/rhiever/tpot/deployments","created_at":"2015-11-03T21:08:40Z","updated_at":"2016-09-27T20:12:18Z","pushed_at":"2016-09-28T15:00:09Z","git_url":"git://github.com/rhiever/tpot.git","ssh_url":"git@github.com:rhiever/tpot.git","clone_url":"https://github.com/rhiever/tpot.git","svn_url":"https://github.com/rhiever/tpot","homepage":"http://rhiever.github.io/tpot/","size":6194,"stargazers_count":1503,"watchers_count":1503,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":194,"mirror_url":null,"open_issues_count":41,"forks":194,"open_issues":41,"watchers":1503,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rhiever/tpot/pulls/278"},"html":{"href":"https://github.com/rhiever/tpot/pull/278"},"issue":{"href":"https://api.github.com/repos/rhiever/tpot/issues/278"},"comments":{"href":"https://api.github.com/repos/rhiever/tpot/issues/278/comments"},"review_comments":{"href":"https://api.github.com/repos/rhiever/tpot/pulls/278/comments"},"review_comment":{"href":"https://api.github.com/repos/rhiever/tpot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rhiever/tpot/pulls/278/commits"},"statuses":{"href":"https://api.github.com/repos/rhiever/tpot/statuses/9cc709a62e4ce3f6bd5e1fcdb7029daf1f1026f2"}}}}
{"actor":{"display_login":"teaearlgraycold"}}