Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hash for filters #827

Merged
merged 6 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Suggests:
lme4,
mlbench,
bbotk (>= 0.3.0),
mlr3filters (>= 0.1.1),
mlr3filters (>= 0.8.1),
mlr3learners,
mlr3measures,
nloptr,
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* New PipeOp `PipeOpDecode` / `po("decode")` to reverse one-hot or treatment encoding.
* Fix: Columns that are `feature` and something else no longer lose the other column role during training or predicting of `PipeOp`s inheriting from `PipeOpTaskPreproc`.
* Fix: Made tests for `PipeOpBLSmote` deterministic.
* Fix: Corrected hash calculation for `PipeOpFilter`.

# mlr3pipelines 0.7.1

Expand Down
2 changes: 1 addition & 1 deletion R/PipeOpFilter.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ PipeOpFilter = R6Class("PipeOpFilter",
.transform = function(task) {
task$select(self$state$features)
},
.additional_phash_input = function() class(self$filter)
.additional_phash_input = function() self$filter$hash
)
)

Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_dictionary.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ test_that("Dictionary contains all PipeOps", {

# the loop now checks whether we can construct each pipeop from the dictionary *and* by itself
for (idx in seq_along(dictnames)) {
if (dictnames[[idx]] == "filter") next # TODO: remove this when https://github.com/mlr-org/mlr3filters/issues/162 is solved

pogen = get(pipeops[idx], pkgenv) # the constructor, as found in the package namespace
dictname = dictnames[idx] # the "key" in the mlr_pipeops dictionary
args = initargs[[pipeops[idx]]] %??% list() # the required arguments, if any. e.g. 'outnum' for PipeOpCopy.
Expand Down