{"action":"created","issue":{"url":"https://api.github.com/repos/mlr-org/mlr/issues/2422","repository_url":"https://api.github.com/repos/mlr-org/mlr","labels_url":"https://api.github.com/repos/mlr-org/mlr/issues/2422/labels{/name}","comments_url":"https://api.github.com/repos/mlr-org/mlr/issues/2422/comments","events_url":"https://api.github.com/repos/mlr-org/mlr/issues/2422/events","html_url":"https://github.com/mlr-org/mlr/issues/2422","id":353467898,"node_id":"MDU6SXNzdWUzNTM0Njc4OTg=","number":2422,"title":"Error when predicting new dataset with single factor values","user":{"login":"mb1069","id":9156542,"node_id":"MDQ6VXNlcjkxNTY1NDI=","avatar_url":"https://avatars1.githubusercontent.com/u/9156542?v=4","gravatar_id":"","url":"https://api.github.com/users/mb1069","html_url":"https://github.com/mb1069","followers_url":"https://api.github.com/users/mb1069/followers","following_url":"https://api.github.com/users/mb1069/following{/other_user}","gists_url":"https://api.github.com/users/mb1069/gists{/gist_id}","starred_url":"https://api.github.com/users/mb1069/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mb1069/subscriptions","organizations_url":"https://api.github.com/users/mb1069/orgs","repos_url":"https://api.github.com/users/mb1069/repos","events_url":"https://api.github.com/users/mb1069/events{/privacy}","received_events_url":"https://api.github.com/users/mb1069/received_events","type":"User","site_admin":false},"labels":[{"id":421271782,"node_id":"MDU6TGFiZWw0MjEyNzE3ODI=","url":"https://api.github.com/repos/mlr-org/mlr/labels/prio-low","name":"prio-low","color":"0e8a16","default":false},{"id":54191378,"node_id":"MDU6TGFiZWw1NDE5MTM3OA==","url":"https://api.github.com/repos/mlr-org/mlr/labels/type-bug","name":"type-bug","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-08-23T16:53:48Z","updated_at":"2018-08-30T18:46:30Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\nI'm having some issue predicting new values from unseen data; this data comes from a single source, and therefore many of the factor-type columns have a single value in this new dataset. However, the original dataset has no constant columns.\r\n\r\nWhen running predict, I am getting the following error:\r\n```R\r\nError in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) : \r\n  contrasts can be applied only to factors with 2 or more levels\r\n```\r\nA minimum example can be found with data here:\r\n[min_example.tar.gz](https://github.com/mlr-org/mlr/files/2315420/min_example.tar.gz)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mlr-org/mlr/issues/comments/417426698","html_url":"https://github.com/mlr-org/mlr/issues/2422#issuecomment-417426698","issue_url":"https://api.github.com/repos/mlr-org/mlr/issues/2422","id":417426698,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzQyNjY5OA==","user":{"login":"larskotthoff","id":579233,"node_id":"MDQ6VXNlcjU3OTIzMw==","avatar_url":"https://avatars2.githubusercontent.com/u/579233?v=4","gravatar_id":"","url":"https://api.github.com/users/larskotthoff","html_url":"https://github.com/larskotthoff","followers_url":"https://api.github.com/users/larskotthoff/followers","following_url":"https://api.github.com/users/larskotthoff/following{/other_user}","gists_url":"https://api.github.com/users/larskotthoff/gists{/gist_id}","starred_url":"https://api.github.com/users/larskotthoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larskotthoff/subscriptions","organizations_url":"https://api.github.com/users/larskotthoff/orgs","repos_url":"https://api.github.com/users/larskotthoff/repos","events_url":"https://api.github.com/users/larskotthoff/events{/privacy}","received_events_url":"https://api.github.com/users/larskotthoff/received_events","type":"User","site_admin":false},"created_at":"2018-08-30T18:46:30Z","updated_at":"2018-08-30T18:46:30Z","author_association":"CONTRIBUTOR","body":"You could create the dummy features in a separate step instead of in a wrapper, or make sure that all levels are always present."}}
{"actor":{"display_login":"larskotthoff"}}