Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

classif.ranger not working when target variable is not in the last column #986

Closed
FlorianPargent opened this issue Jul 4, 2016 · 5 comments
Labels

Comments

@FlorianPargent
Copy link

use classif.ranger to predict "diabetes" in pid.task (this works)

lrn = makeLearner("classif.ranger")
holdout(lrn, pid.task)

however, when "diabetes" is not the last but the second last variable in the dataframe
resampling does not work

task = makeClassifTask(data = getTaskData(pid.task)[,c(2:9, 1)], target = "diabetes")
holdout(lrn, task)
@bhvieira
Copy link
Contributor

bhvieira commented Jul 4, 2016

Hmm, sometimes it even crashes RGui.exe for me. iris.task worked fine with Species as the first column, changing it to second crashed the execution.

@jakob-r
Copy link
Member

jakob-r commented Jul 5, 2016

Can you check running it for ranger directly? If this crashes (what I think will happen) I will contact @mnwright but until then I propose the workaround to simply put the target column in the last column via something like

data = getTaskData(.task, .subset, target.extra = TRUE)
ranger::ranger(formula = NULL, dependent.variable = tn, data = cbind(data$task, data$target), write.forest = TRUE, ...)

@berndbischl
Copy link
Member

hi this really seems like a 100% ranger problem.
please reopen if you can confirm that this has anything to do with mlr.

@mnwright
Copy link
Contributor

mnwright commented Jul 6, 2016

Fixed in ranger.

@berndbischl
Copy link
Member

Fixed in ranger.

cool thx. mlr seems to work nicely as a "bug detector" for other packages :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants