{"action":"created","issue":{"url":"https://api.github.com/repos/imbs-hl/ranger/issues/312","repository_url":"https://api.github.com/repos/imbs-hl/ranger","labels_url":"https://api.github.com/repos/imbs-hl/ranger/issues/312/labels{/name}","comments_url":"https://api.github.com/repos/imbs-hl/ranger/issues/312/comments","events_url":"https://api.github.com/repos/imbs-hl/ranger/issues/312/events","html_url":"https://github.com/imbs-hl/ranger/issues/312","id":319505537,"number":312,"title":"Probability Predictions with Sparse Matrices","user":{"login":"illusive-git","id":32738992,"avatar_url":"https://avatars3.githubusercontent.com/u/32738992?v=4","gravatar_id":"","url":"https://api.github.com/users/illusive-git","html_url":"https://github.com/illusive-git","followers_url":"https://api.github.com/users/illusive-git/followers","following_url":"https://api.github.com/users/illusive-git/following{/other_user}","gists_url":"https://api.github.com/users/illusive-git/gists{/gist_id}","starred_url":"https://api.github.com/users/illusive-git/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/illusive-git/subscriptions","organizations_url":"https://api.github.com/users/illusive-git/orgs","repos_url":"https://api.github.com/users/illusive-git/repos","events_url":"https://api.github.com/users/illusive-git/events{/privacy}","received_events_url":"https://api.github.com/users/illusive-git/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-02T10:56:26Z","updated_at":"2018-05-04T11:11:44Z","closed_at":"2018-05-04T09:52:41Z","author_association":"NONE","body":"Hello,\r\n\r\nI have an issue using the predict function when training the ranger on sparse matrices:\r\n```R\r\nlibrary(Matrix)\r\nlibrary(ranger)\r\n# create a random sparse matrix\r\nA = Matrix(data = rbinom(1000*10000,size = 1,prob = 0.2),nrow = 10000,ncol = 1000,sparse = TRUE,\r\n    dimnames = list(NULL,lapply(1:1000,as.character)))\r\n\r\n# add the label and call it AAA\r\nA_2 = cbind(A,rbinom(10000,size = 20,prob = 0.5))\r\nA_2@Dimnames[[2]][length(A_2@Dimnames[[2]])] = \"AAA\"\r\n\r\n\r\n# ranger call\r\nlarge_ranger = ranger(data = A_2,\r\n                      dependent.variable.name = \"AAA\",\r\n                      classification = TRUE,\r\n                      num.trees = 10,\r\n                      importance = \"impurity\",\r\n                      min.node.size = 1,\r\n                      probability = TRUE)\r\n\r\n# predictions in call\r\nlarge_ranger$predictions[1]\r\n\r\n# predict function\r\ntest = predict(large_ranger,data = A)\r\ntest$predictions[1]\r\n\r\n```\r\nThe in-object predictions are completely fine, but if I call the predict function I receive a single zero every time. It also gives number of samples as 2. Error both on rstudio server ubuntu and R on mint.\r\n\r\nMy current workaround is to set Probability = FALSE and take the relative class occurence in the predict.all = TRUE output.\r\n\r\nThank you,\r\nMax"},"comment":{"url":"https://api.github.com/repos/imbs-hl/ranger/issues/comments/386570029","html_url":"https://github.com/imbs-hl/ranger/issues/312#issuecomment-386570029","issue_url":"https://api.github.com/repos/imbs-hl/ranger/issues/312","id":386570029,"user":{"login":"illusive-git","id":32738992,"avatar_url":"https://avatars3.githubusercontent.com/u/32738992?v=4","gravatar_id":"","url":"https://api.github.com/users/illusive-git","html_url":"https://github.com/illusive-git","followers_url":"https://api.github.com/users/illusive-git/followers","following_url":"https://api.github.com/users/illusive-git/following{/other_user}","gists_url":"https://api.github.com/users/illusive-git/gists{/gist_id}","starred_url":"https://api.github.com/users/illusive-git/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/illusive-git/subscriptions","organizations_url":"https://api.github.com/users/illusive-git/orgs","repos_url":"https://api.github.com/users/illusive-git/repos","events_url":"https://api.github.com/users/illusive-git/events{/privacy}","received_events_url":"https://api.github.com/users/illusive-git/received_events","type":"User","site_admin":false},"created_at":"2018-05-04T11:11:44Z","updated_at":"2018-05-04T11:11:44Z","author_association":"NONE","body":"Thanks a lot for the quick fix! A happy weekend to your from Berlin."}}
{"actor":{"display_login":"illusive-git"}}