I would like to reduce multiclass classification targets to binary classification targets. Ideally, this mapping would happen within scikit-learn so the same transformation applies during both training and prediction.
I looked at transforming the prediction target (y) documentation but did not see something that would work. Ideally, it would be a classifier version of TransformedTargetRegressor.
Something like this mapping:
targets_multi = {'A', 'B', 'C', 'D'}
targets_binary = {0: {'A', 'B'},
1: {'C', 'D'}}
targets_multi
from a set into a list and then create your new dictionarytargets_binary
$\endgroup$