{"action":"created","issue":{"url":"https://api.github.com/repos/rhiever/tpot/issues/215","repository_url":"https://api.github.com/repos/rhiever/tpot","labels_url":"https://api.github.com/repos/rhiever/tpot/issues/215/labels{/name}","comments_url":"https://api.github.com/repos/rhiever/tpot/issues/215/comments","events_url":"https://api.github.com/repos/rhiever/tpot/issues/215/events","html_url":"https://github.com/rhiever/tpot/issues/215","id":171490067,"number":215,"title":"Add OneHotEncoder operator","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},"labels":[{"url":"https://api.github.com/repos/rhiever/tpot/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/rhiever/tpot/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/rhiever/tpot/milestones/4","html_url":"https://github.com/rhiever/tpot/milestones/TPOT%20v0.7","labels_url":"https://api.github.com/repos/rhiever/tpot/milestones/4/labels","id":1970226,"number":4,"title":"TPOT v0.7","description":"","creator":{"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},"open_issues":8,"closed_issues":0,"state":"open","created_at":"2016-08-29T17:44:52Z","updated_at":"2016-09-01T03:11:23Z","due_on":"2016-09-16T00:00:00Z","closed_at":null},"comments":4,"created_at":"2016-08-16T18:51:46Z","updated_at":"2016-09-01T16:00:08Z","closed_at":null,"body":"We should add the sklearn [OneHotEncoder](http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.OneHotEncoder.html) operator to TPOT's primitive set. It's useful for many classifiers for making predictions from categorical features.\r\n\r\nThe OHE operator should append the one-hot encoded features to the original feature set.\r\n\r\nHowever, we shouldn't apply it to all features, especially not continuous features. I think a smart way to handle this is to only apply OHE to values within features that comprise some minimum fraction of the feature's total.\r\n\r\ne.g., if a feature's values are `[0, 0, 0, 1, 1, 1, 2, 2, 2, 3]` and the minimum fraction is `0.2`, then the OHE will one-hot encode only `0`, `1`, and `2` as separate features. auto-sklearn has a [custom implementation](https://github.com/automl/auto-sklearn/blob/development/autosklearn/pipeline/implementations/OneHotEncoder.py) of the OneHotEncoder that does this. We can make the minimum fraction an evolvable parameter, with a minimum of e.g. 0.01.\r\n\r\nWe should also set `handle_unknown` to `'ignore'` so TPOT doesn't crash if a value is encountered in the testing set that wasn't encountered in the training set."},"comment":{"url":"https://api.github.com/repos/rhiever/tpot/issues/comments/244126529","html_url":"https://github.com/rhiever/tpot/issues/215#issuecomment-244126529","issue_url":"https://api.github.com/repos/rhiever/tpot/issues/215","id":244126529,"user":{"login":"slcott","id":3630176,"avatar_url":"https://avatars.githubusercontent.com/u/3630176?v=3","gravatar_id":"","url":"https://api.github.com/users/slcott","html_url":"https://github.com/slcott","followers_url":"https://api.github.com/users/slcott/followers","following_url":"https://api.github.com/users/slcott/following{/other_user}","gists_url":"https://api.github.com/users/slcott/gists{/gist_id}","starred_url":"https://api.github.com/users/slcott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slcott/subscriptions","organizations_url":"https://api.github.com/users/slcott/orgs","repos_url":"https://api.github.com/users/slcott/repos","events_url":"https://api.github.com/users/slcott/events{/privacy}","received_events_url":"https://api.github.com/users/slcott/received_events","type":"User","site_admin":false},"created_at":"2016-09-01T16:00:08Z","updated_at":"2016-09-01T16:00:08Z","body":"I followed your comments and created a pull request of the product. \r\n\r\nHonestly, it's my first PR so I hope it works.\r\n\r\nI'm still getting used to the library so I haven't tested the code yet. Some guidance on that would help me make that for following some best practices."}}
{"actor":{"display_login":"slcott"}}