-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
FEA Add TransformedTargetClassifier #29952
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
…arn into transformed_target_clf
Hi, came across your work while looking for this functionality. Just wondering whether you're planning to finish this up? I'm considering having a go at a PR of my own otherwise. Thanks! |
Hi @oelhammouchi, sorry it took so long, I had to focus on other things lately. I am planning to take this up again in the next few weeks. The TransformedTargetClassifier itself is basically implemented and I just want to add a few tests before I ask for a review. |
Great, then I'll hold off on it. Thanks again! |
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
Signed-off-by: Guillaume Tauzin <4648633+gtauzin@users.noreply.github.com>
There is a single test failing: I am not sure what is the best way to tackle that (changing the default, removing validation, etc...) so I'll wait for maintainers guidance. |
Reference Issues/PRs
Fixes #20952.
What does this implement/fix? Explain your changes.
This PR adds
TransformedTargetClassifier
, a classification counterpart to the regression-orientedTransformedTargetRegressor
.Task list
regressor
in favor ofestimator
in TransformedTargetRegressorImportant points
BaseTransformedTarget
in a similar spirit than what is done for the bagging estimators withBaseBagging
. However, this introduces a breaking change forTransformedTargetRegressor
: the estimator constructor argument is renamed fromregressor
toestimator
. I deprecated the former in favor of the latter.TransformedTargetRegressor
, the transformer is meant to be any sklearn transformer and therefore accept 2d inputs, things are not so clear forTransformedTargetClassifier
. Natural transformers in that case would be label transformers:LabelEncoder
,LabelBinarizer
andMultipleLabelBinarizer
, which will warn in case the input is 2d. To avoid that I can make sure the input is 1d ifinput_tags.two_d_array = False
.LabelEncoder
along with classifier that do not use it internally (so external to sklearn, eg.XGBoostClassifier
). As it only make sense along with 3rd party classifiers, I feel I should probably not try and add an example to the gallery.y
like?Please don't hesitate to leave any feedback, I am here to learn :)