peal.visualization.model_comparison.change_all¶
- peal.visualization.model_comparison.change_all(x, target_index, current_index)[source]¶
Build the indicator tensor of one criterion over all criterion combos.
Recursively descends the
2 x 2 x ... x 2tensorx; at depthtarget_indexthe first half is set to 0 and the second to 1, so the result marks which combinations have criteriontarget_indextrue.- Parameters:
x (
torch.Tensor) – Tensor of shape[2] * n_criteria(values ignored, shape used).target_index (
int) – Axis (criterion) whose indicator is built.current_index (
int) – Current recursion depth; start with 0.
- Returns:
Same shape as
x, 1 where axistarget_indexhas index 1.- Return type: