Skip to content

Commit

Permalink
Fix task data (#2107)
Browse files Browse the repository at this point in the history
* Fixing surv task data files for problem #2010

* renewing tasks that differed from what changeData() gives

* test for changed data format
  • Loading branch information
mb706 authored and zmjones committed Dec 19, 2017
1 parent 37f38b4 commit 728657f
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 0 deletions.
Binary file modified data/bc.task.spatial.rda
Binary file not shown.
Binary file modified data/costiris.task.rda
Binary file not shown.
Binary file modified data/gunpoint.task.rda
Binary file not shown.
Binary file modified data/lung.task.rda
Binary file not shown.
Binary file modified data/phoneme.task.rda
Binary file not shown.
Binary file modified data/wpbc.task.rda
Binary file not shown.
Binary file modified data/yeast.task.rda
Binary file not shown.
13 changes: 13 additions & 0 deletions tests/testthat/test_base_checkData.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,16 @@ test_that("checkData", {
colnames(df)[1] = "aaa"
expect_error(makeClassifTask(data = df, target = multiclass.target), "Unsupported feature type")
})

test_that("changeData . getTaskData is a noop on builtin tasks", {
# We expect changeData(task, getTaskData(task, ...)) to not change task.
# If it does, it means that the internal format of task or task.desc has
# changed, and that the data needs to be re-generated.
pkgdata = data(package = "mlr")$results[, "Item"]
tasknames = grep("\\.task$", pkgdata, value = TRUE)
for (task in tasknames) {
taskdata = get(task)
changeddata = changeData(taskdata, getTaskData(taskdata, functionals.as = "matrix"))
expect_equal(taskdata, changeddata)
}
})

0 comments on commit 728657f

Please sign in to comment.