{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn-contrib/categorical-encoding/issues/26","repository_url":"https://api.github.com/repos/scikit-learn-contrib/categorical-encoding","labels_url":"https://api.github.com/repos/scikit-learn-contrib/categorical-encoding/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn-contrib/categorical-encoding/issues/26/comments","events_url":"https://api.github.com/repos/scikit-learn-contrib/categorical-encoding/issues/26/events","html_url":"https://github.com/scikit-learn-contrib/categorical-encoding/issues/26","id":235939106,"number":26,"title":"re-using pickled/saved encoders","user":{"login":"davidsbatista","id":7937824,"avatar_url":"https://avatars1.githubusercontent.com/u/7937824?v=3","gravatar_id":"","url":"https://api.github.com/users/davidsbatista","html_url":"https://github.com/davidsbatista","followers_url":"https://api.github.com/users/davidsbatista/followers","following_url":"https://api.github.com/users/davidsbatista/following{/other_user}","gists_url":"https://api.github.com/users/davidsbatista/gists{/gist_id}","starred_url":"https://api.github.com/users/davidsbatista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidsbatista/subscriptions","organizations_url":"https://api.github.com/users/davidsbatista/orgs","repos_url":"https://api.github.com/users/davidsbatista/repos","events_url":"https://api.github.com/users/davidsbatista/events{/privacy}","received_events_url":"https://api.github.com/users/davidsbatista/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-14T16:33:55Z","updated_at":"2017-06-16T09:53:53Z","closed_at":null,"body":"I've trained a model, for which I use the one-hot-encoder, and let's say a categorical variable, e.g. `device_type`, had 20 possible values, the trained model is now expecting to see, among other columns, 20 columns related with the values of `device_type`, i.e.:\r\n\r\n `device_type_0, device_type_1, ..., device_type_20` \r\n\r\nI also saved/pickled this trained model as well as the one-hot-encoder.\r\n\r\nI now have new data coming, and the `device_type`, for this new data, only has 10 possible values. I was assuming that by applying the pickled/saved one-hot-encoder which I used before, I would see the same 20 columns related with the values of `device_type`, i.e.:\r\n\r\n `device_type_0, device_type_1, ..., device_type_20`\r\n\r\nBut I only see 10 `device_type_X` columns, i.e., only for the values presente in the new data.\r\n\r\nIs there something I'm missing when I instantiate the encoder, or a parameter I'm missing when applying the fit, or simply this functionality is not implemented ?"},"comment":{"url":"https://api.github.com/repos/scikit-learn-contrib/categorical-encoding/issues/comments/308984642","html_url":"https://github.com/scikit-learn-contrib/categorical-encoding/issues/26#issuecomment-308984642","issue_url":"https://api.github.com/repos/scikit-learn-contrib/categorical-encoding/issues/26","id":308984642,"user":{"login":"davidsbatista","id":7937824,"avatar_url":"https://avatars1.githubusercontent.com/u/7937824?v=3","gravatar_id":"","url":"https://api.github.com/users/davidsbatista","html_url":"https://github.com/davidsbatista","followers_url":"https://api.github.com/users/davidsbatista/followers","following_url":"https://api.github.com/users/davidsbatista/following{/other_user}","gists_url":"https://api.github.com/users/davidsbatista/gists{/gist_id}","starred_url":"https://api.github.com/users/davidsbatista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidsbatista/subscriptions","organizations_url":"https://api.github.com/users/davidsbatista/orgs","repos_url":"https://api.github.com/users/davidsbatista/repos","events_url":"https://api.github.com/users/davidsbatista/events{/privacy}","received_events_url":"https://api.github.com/users/davidsbatista/received_events","type":"User","site_admin":false},"created_at":"2017-06-16T09:53:53Z","updated_at":"2017-06-16T09:53:53Z","body":"mea culpa! I was simple doing `fit_transform`, thanks for the reply.\r\n\r\nOne more question, how does this pickled `one-hot-encoder` will handle unseen values for a categorical variable?"}}
{"actor":{"display_login":"davidsbatista"}}