{"action":"closed","issue":{"url":"https://api.github.com/repos/mlr-org/mlr/issues/1259","repository_url":"https://api.github.com/repos/mlr-org/mlr","labels_url":"https://api.github.com/repos/mlr-org/mlr/issues/1259/labels{/name}","comments_url":"https://api.github.com/repos/mlr-org/mlr/issues/1259/comments","events_url":"https://api.github.com/repos/mlr-org/mlr/issues/1259/events","html_url":"https://github.com/mlr-org/mlr/issues/1259","id":178566739,"number":1259,"title":"Error in predict.ranger.forest(forest, data, predict.all, seed, num.threads,  :    Missing values in data, variable x appears to be constant within groups.. when predicting using undersampled data","user":{"login":"mhmdshari","id":12201123,"avatar_url":"https://avatars.githubusercontent.com/u/12201123?v=3","gravatar_id":"","url":"https://api.github.com/users/mhmdshari","html_url":"https://github.com/mhmdshari","followers_url":"https://api.github.com/users/mhmdshari/followers","following_url":"https://api.github.com/users/mhmdshari/following{/other_user}","gists_url":"https://api.github.com/users/mhmdshari/gists{/gist_id}","starred_url":"https://api.github.com/users/mhmdshari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhmdshari/subscriptions","organizations_url":"https://api.github.com/users/mhmdshari/orgs","repos_url":"https://api.github.com/users/mhmdshari/repos","events_url":"https://api.github.com/users/mhmdshari/events{/privacy}","received_events_url":"https://api.github.com/users/mhmdshari/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-09-22T09:53:59Z","updated_at":"2016-11-27T21:49:43Z","closed_at":"2016-11-27T21:49:43Z","body":" I use the following code to  undersample the majority class in training data and predict. \n\n```\n  trainTask = makeClassifTask(data = train,target = \"cls\", positive = \"yes\")\n  testTask = makeClassifTask(data = test, target = \"cls\",  positive = \"yes\")\n  trainTask = undersample(trainTask, rate = 0.1)\n  trainTask =removeConstantFeatures(trainTask)\n  Clslearn = makeLearner(clsnam, predict.type = \"prob\")\n  trained = train(Clslearn, trainTask)\n  predicted = predict(trained, testTask)\n```\n\nFor most of the classifiers such as xgboost, ada,avNNet,C50, gbm,IBk, J48 etc I dont have any issues.\nBut for classif.ranger I get \n\n```\nError in predict.ranger.forest(forest, data, predict.all, seed, num.threads,  : \n  Missing values in data.\n```\n\nand for classif.lda I get  the error\n`variable 49 appears to be constant within groups`\n\nPls note that the above specified algorithms work fine when applied on the original data.\n\nPlease kindly help me  to fix these issues.\n"}}
{"actor":{"display_login":"larskotthoff"}}