Skip to content

Commit

Permalink
PipeOpTaskPreproc should work with features that also have other roles
Browse files Browse the repository at this point in the history
  • Loading branch information
mb706 authored Jan 16, 2025
1 parent e736e76 commit 2c790cc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions R/PipeOpTaskPreproc.R
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,8 @@ PipeOpTaskPreproc = R6Class("PipeOpTaskPreproc",
if (do_subset) {
affected_cols = self$param_set$values$affect_columns(intask)
assert_subset(affected_cols, intask$feature_names, empty.ok = TRUE)
# FIXME: this fails when something is both a feature and something else
remove_cols = setdiff(intask$feature_names, affected_cols)
intask$col_roles = map(intask$col_roles, .f = setdiff, y = remove_cols)
intask$col_roles$feature = affected_cols
}
intasklayout = copy(intask$feature_types)

Expand All @@ -228,7 +227,6 @@ PipeOpTaskPreproc = R6Class("PipeOpTaskPreproc",
}

if (do_subset) {
# FIXME: this fails if .train_task added a column with the same name
intask$col_roles$feature = union(intask$col_roles$feature, y = remove_cols)
}

Expand Down

0 comments on commit 2c790cc

Please sign in to comment.