{"action":"opened","issue":{"url":"https://api.github.com/repos/imbs-hl/ranger/issues/143","repository_url":"https://api.github.com/repos/imbs-hl/ranger","labels_url":"https://api.github.com/repos/imbs-hl/ranger/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/imbs-hl/ranger/issues/143/comments","events_url":"https://api.github.com/repos/imbs-hl/ranger/issues/143/events","html_url":"https://github.com/imbs-hl/ranger/issues/143","id":189997245,"number":143,"title":"Error with using predict.ranger for \"Probability estimation\" Error in result$predictions[, forest$levels, drop = FALSE] :    subscript out of bounds","user":{"login":"thengl","id":640722,"avatar_url":"https://avatars.githubusercontent.com/u/640722?v=3","gravatar_id":"","url":"https://api.github.com/users/thengl","html_url":"https://github.com/thengl","followers_url":"https://api.github.com/users/thengl/followers","following_url":"https://api.github.com/users/thengl/following{/other_user}","gists_url":"https://api.github.com/users/thengl/gists{/gist_id}","starred_url":"https://api.github.com/users/thengl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thengl/subscriptions","organizations_url":"https://api.github.com/users/thengl/orgs","repos_url":"https://api.github.com/users/thengl/repos","events_url":"https://api.github.com/users/thengl/events{/privacy}","received_events_url":"https://api.github.com/users/thengl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-17T09:59:26Z","updated_at":"2016-11-17T09:59:26Z","closed_at":null,"body":"I've started getting an error message with v0.6-1 of ranger when I run predict using a : \r\n\r\n```\r\n> v = round(predict(mRF, m@data, probability=TRUE)$predictions*100)\r\nError in result$predictions[, forest$levels, drop = FALSE] : \r\n  subscript out of bounds\r\n```\r\n\r\nIn my case the number of levels used for model training and number of levels that comes out in the final model is a bit different, so maybe that causes problems:\r\n\r\n```\r\n> str(attr(mRF$predictions, \"dimnames\")[[2]])\r\n chr [1:291] \"Acraquox\" \"Acrudox\" \"Alaquods\" \"Albaqualfs\" \"Albaquults\" \"Alorthods\" ...\r\n> str(mRF$forest$levels)\r\n chr [1:318] \"Acraquox\" \"Acrorthox\" \"Acrudox\" \"Acrustox\" \"Alaquods\" \"Albaqualfs\" ...\r\n```\r\n\r\nI see that you have [changed the code recently](https://github.com/imbs-hl/ranger/commit/7ae6a845e1026bf1153c49742764021e1c840475#diff-d25034c07e94e9ebd6bff7e9ff029e14) so that subsetting of the results is done with `drop=FALSE` (maybe that causes problems?). Let me know if I can send you my model and prediction locations for testing."}}
{"actor":{"display_login":"thengl"}}