{"action":"closed","issue":{"url":"https://api.github.com/repos/mlr-org/mlr/issues/627","labels_url":"https://api.github.com/repos/mlr-org/mlr/issues/627/labels{/name}","comments_url":"https://api.github.com/repos/mlr-org/mlr/issues/627/comments","events_url":"https://api.github.com/repos/mlr-org/mlr/issues/627/events","html_url":"https://github.com/mlr-org/mlr/issues/627","id":123084400,"number":627,"title":"tuneParams using IRace fails with discrete parameters that are not character","user":{"login":"mb706","id":15801081,"avatar_url":"https://avatars.githubusercontent.com/u/15801081?v=3","gravatar_id":"","url":"https://api.github.com/users/mb706","html_url":"https://github.com/mb706","followers_url":"https://api.github.com/users/mb706/followers","following_url":"https://api.github.com/users/mb706/following{/other_user}","gists_url":"https://api.github.com/users/mb706/gists{/gist_id}","starred_url":"https://api.github.com/users/mb706/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mb706/subscriptions","organizations_url":"https://api.github.com/users/mb706/orgs","repos_url":"https://api.github.com/users/mb706/repos","events_url":"https://api.github.com/users/mb706/events{/privacy}","received_events_url":"https://api.github.com/users/mb706/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mlr-org/mlr/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/mlr-org/mlr/labels/PR%20in%20review","name":"PR in review","color":"207de5"}],"state":"closed","locked":false,"assignee":{"login":"berndbischl","id":1225974,"avatar_url":"https://avatars.githubusercontent.com/u/1225974?v=3","gravatar_id":"","url":"https://api.github.com/users/berndbischl","html_url":"https://github.com/berndbischl","followers_url":"https://api.github.com/users/berndbischl/followers","following_url":"https://api.github.com/users/berndbischl/following{/other_user}","gists_url":"https://api.github.com/users/berndbischl/gists{/gist_id}","starred_url":"https://api.github.com/users/berndbischl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berndbischl/subscriptions","organizations_url":"https://api.github.com/users/berndbischl/orgs","repos_url":"https://api.github.com/users/berndbischl/repos","events_url":"https://api.github.com/users/berndbischl/events{/privacy}","received_events_url":"https://api.github.com/users/berndbischl/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-12-19T13:01:50Z","updated_at":"2015-12-20T20:32:01Z","closed_at":"2015-12-20T20:32:01Z","body":"`tuneIrace()` calls `ParamHelpers::convertParamSetToIrace()` which converts discrete parameters into discrete *character* parameters using the *names()* of the parameter `$values`. However, the fitness function (`hookRun` in tuneIrace.R) makes no effort translating from names back to parameter values (it *does* translate logical parameters though).\r\n\r\nThis works fine, as long as the discrete parameter `values` vector is of mode character for which names equal values (default when created using `makeDiscreteParam()`); in other cases it causes errors:\r\n```R\r\n> lrn = makeLearner(\"classif.randomForest\")\r\n> ctrl = makeTuneControlIrace(maxExperiments = 200L)\r\n> ps = makeParamSet(makeDiscreteParam(\"ntree\", c(100, 200))) # !! create discrete numeric param\r\n> tuneParams(lrn, iris.task, rdesc, par.set = ps, control = ctrl)\r\n[Tune] Started tuning learner classif.randomForest for parameter set:\r\n          Type len Def  Constr Req Tunable Trafo\r\nntree discrete   -   - 100,200   -    TRUE     -\r\nWith control class: TuneControlIrace\r\nImputation value: 1\r\n[Tune-x] Setting hyperpars failed: Error in setHyperPars2.Learner(learner, insert(par.vals, args)) :\r\n  100 is not feasible for parameter 'ntree'!\r\n\r\nError in getIndex(par$values, x) : Value not found!\r\n```\r\n(The error message is a bit misleading: the parameter value that IRace tries to set for ntree is the **character** \"100\", it should be the **numeric** 100. Consider:\r\n```R\r\n> lrn = makeLearner(\"classif.randomForest\")\r\n> ctrl = makeTuneControlIrace(maxExperiments = 200L)\r\n> ps = makeParamSet(makeDiscreteParam(\"ntree\", c(name100=100, name200=200)))\r\n> tuneParams(lrn, iris.task, rdesc, par.set = ps, control = ctrl)\r\n[Tune] Started tuning learner classif.randomForest for parameter set:\r\n          Type len Def          Constr Req Tunable Trafo\r\nntree discrete   -   - name100,name200   -    TRUE     -\r\nWith control class: TuneControlIrace\r\nImputation value: 1\r\n[Tune-x] Setting hyperpars failed: Error in setHyperPars2.Learner(learner, insert(par.vals, args)) :\r\n  name100 is not feasible for parameter 'ntree'!\r\n\r\nError in getIndex(par$values, x) : Value not found!\r\n```\r\n)"}}