Skip to content

Commit

Permalink
fix new_target condition
Browse files Browse the repository at this point in the history
  • Loading branch information
advieser authored Feb 23, 2025
1 parent 083def4 commit fe42407
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/PipeOpTrafo.R
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ PipeOpTargetMutate = R6Class("PipeOpTargetMutate",

.transform = function(task, phase) {
new_target = self$param_set$values$trafo(task$data(cols = task$target_names))
if (!is.data.frame(new_target) || !is.matrix(new_target)) {
if (!is.data.frame(new_target) && !is.matrix(new_target)) {
stopf("Hyperparameter 'trafo' must be a function returning a 'data.frame', 'data.table', or 'matrix', not '%s'.", class(new_target))
}
task$cbind(new_target)
Expand Down

0 comments on commit fe42407

Please sign in to comment.