{"action":"created","issue":{"url":"https://api.github.com/repos/berndbischl/mlr/issues/245","labels_url":"https://api.github.com/repos/berndbischl/mlr/issues/245/labels{/name}","comments_url":"https://api.github.com/repos/berndbischl/mlr/issues/245/comments","events_url":"https://api.github.com/repos/berndbischl/mlr/issues/245/events","html_url":"https://github.com/berndbischl/mlr/issues/245","id":58061919,"number":245,"title":"Error in analyzeFeatSelResult when using tune.threshold in makeFeatSelControlSequential","user":{"login":"phASL","id":9842170,"avatar_url":"https://avatars.githubusercontent.com/u/9842170?v=3","gravatar_id":"","url":"https://api.github.com/users/phASL","html_url":"https://github.com/phASL","followers_url":"https://api.github.com/users/phASL/followers","following_url":"https://api.github.com/users/phASL/following{/other_user}","gists_url":"https://api.github.com/users/phASL/gists{/gist_id}","starred_url":"https://api.github.com/users/phASL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phASL/subscriptions","organizations_url":"https://api.github.com/users/phASL/orgs","repos_url":"https://api.github.com/users/phASL/repos","events_url":"https://api.github.com/users/phASL/events{/privacy}","received_events_url":"https://api.github.com/users/phASL/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-18T12:31:19Z","updated_at":"2015-05-07T18:08:09Z","closed_at":"2015-05-07T18:08:09Z","body":"When doing a feature selection with threshold tuning and then using analyzeFeatSelResult to print some nice results, an error occurs.\r\nI was able to track the error back to the ParamHelpers and BBmisc packages, but I'm not sure, what exactly is the reason for it...\r\n\r\nHere's some example code producing the error:\r\n\r\n```R\r\nlibrary(\"mlr\")\r\nset.seed(1909)\r\nctrl = makeFeatSelControlSequential(method = \"sfs\", alpha = 0.1, tune.threshold = TRUE)\r\nrdesc = makeResampleDesc(\"Holdout\")\r\nlrn = makeLearner(\"classif.lda\", predict.type = \"prob\")\r\nsfeats = selectFeatures(learner = lrn, task = sonar.task, resampling = rdesc, control = ctrl,\r\n  show.info = FALSE)\r\nanalyzeFeatSelResult(sfeats)\r\n# Features         : 1\r\n# Performance      : mmce.test.mean=0.171\r\n# V12\r\n# \r\n# Path to optimum:\r\n# Error in analyzeFeatSelResult(sfeats) : \r\n# Assertion on 'rows' failed: May only contain the following types: vector\r\n```\r\nHere is some step-by-step code to track the error.\r\n\r\n```R\r\n##### At first you can see, that the problem comes from ParamHelpers:::as.data.frame.OptPathDF.\r\n\r\nParamHelpers:::as.data.frame.OptPathDF(sfeats$opt.path)\r\n# Error in ParamHelpers:::as.data.frame.OptPathDF(sfeats$opt.path) : \r\n#   Assertion on 'rows' failed: May only contain the following types: vector\r\n\r\n##### These are the relevant things that happen in as.data.frame.OptPathDF:\r\n\r\nx = sfeats$opt.path\r\ndob = x$env$dob\r\neol = x$env$eol\r\ndob = checkmate:::asInteger(dob)\r\neol = checkmate:::asInteger(eol)\r\nind = ParamHelpers:::getOptPathDobAndEolIndex(x, dob, eol)\r\n\r\n##### In line 32 of ParamHelpers:::as.data.frame.OptPathDF this function of BBmisc is used:\r\n\r\nBBmisc:::convertListOfRowsToDataFrame(x$env$extra[ind])\r\n# Error in BBmisc:::convertListOfRowsToDataFrame(x$env$extra[ind]) : \r\n#   Assertion on 'rows' failed: May only contain the following types: vector\r\n\r\n##### In the convertListOfRowsToDataFrame function, these things happen:\r\n\r\nrows = x$env$extra[ind]\r\ncheckmate:::assertList(rows)\r\ncheckmate:::assertList(rows, types = \"vector\")\r\n# Error in checkmate:::assertList(rows, types = \"vector\") : \r\n#   Assertion on 'rows' failed: May only contain the following types: vector\r\n\r\n##### The problem is that the \"ind\" vector is longer than the \"x$env$extra\" list,\r\n##### so that the last element of \"rows\" becomes NULL.\r\n##### That's why assertList(rows, types = \"vector\") returns an error.\r\n\r\nlength(x$env$extra)\r\n# 119\r\nlength(ind)\r\n# 120\r\n\r\nstr(rows[[length(ind)-1]])\r\n# List of 1\r\n# $ threshold: num 0.53\r\n\r\nstr(rows[[length(ind)]])\r\n# NULL\r\n```"},"comment":{"url":"https://api.github.com/repos/berndbischl/mlr/issues/comments/99963562","html_url":"https://github.com/berndbischl/mlr/issues/245#issuecomment-99963562","issue_url":"https://api.github.com/repos/berndbischl/mlr/issues/245","id":99963562,"user":{"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},"created_at":"2015-05-07T18:08:09Z","updated_at":"2015-05-07T18:08:09Z","body":"Thx to @kerschke who fixed"}}