ITADN

PipeOpTargetTrafoScaleRange fails with an internal_valid_task

#989Openwmay 创建于 2026-03-27
W
wmaycommented
When using `PipeOpTargetTrafoScaleRange`, if the task has an `internal_valid_task`, it fails with an error. Here's a reproducible example: ```R task = tsk("boston_housing") task$internal_valid_task = sample(task$nrow, 10) po = PipeOpTargetTrafoScaleRange$new() po$train(list(task)) ``` This raises the error: ``` Error in assert_subset(target, choices = intask$col_info$id) %??% intask$target_names : Assertion on 'target' failed: Must be a subset of {'..row_id','age','b','chas','cmedv','crim','dis','indus','lat','lon','lstat','nox','ptratio','rad','rm','tax','town','tract','zn'}, but has additional elements {'cmedv.scaled'}. This happened in PipeOp targettrafoscalerange's $train() ``` This seems to happen because the internal `.transform` method adds the new target to the task using `task$cbind(new_target)`, but it neglects to add the target to the internal validation task. Then the assertion fails when `convert_task` is applied to the internal task.
0 条评论