mlr3pipelines
mlr3pipelines copied to clipboard
PipeOpFeatureUnion breaks predict_newdata when all features of original task aver overwritten
Another POFU issue...
apparently DataBackendRename$missings
breaks when queried for no columns. This happens because cbind()
overwrites all columns in this case.
> gr <- list(po("select", selector = selector_none()), po("nop")) %>>!% po("featureunion", innum = c("a", "")) %>>!%
+ { l <- lrn("classif.rpart") ; l$properties <- setdiff(l$properties, "missings") ; l }
> gr$train(tsk("iris"))
$classif.rpart.output
NULL
> gr$predict(tsk("iris"))
$classif.rpart.output
<PredictionClassif> for 150 observations:
row_ids truth response
1 setosa setosa
2 setosa setosa
3 setosa setosa
---
148 virginica virginica
149 virginica virginica
150 virginica virginica
> lr <- as_learner(gr)
> lr$train(tsk("iris"))
> lr$predict_newdata(iris[1:4])
Error in map_values(names(x), self$old, self$new) :
Assertion on 'x' failed: Must be of type 'atomic vector', not 'NULL'.
This happened PipeOp classif.rpart's $predict()