feature_engine icon indicating copy to clipboard operation
feature_engine copied to clipboard

automate detection of classifier and regressor for tree based transformers

Open solegalli opened this issue 5 years ago • 9 comments

At the moment, in the categorical tree encoder and the tree discretiser, we have an argument is_regression that the user needs to fill in in order to detect if the user is aiming to perform classification or regression.

Sklearn has an automated process with the is_classification (see Decision tree source code).

Can we bring this functionality to feature-engine?

I think we can :p

solegalli avatar Dec 05 '20 12:12 solegalli

Hi @solegalli

This problem looks interesting, is still available? I would like to get more details about it. :)

kind regards.

indymnv avatar Apr 13 '21 10:04 indymnv

Hi @indymnv

At the moment, the classes in feature-engine take a parameter where the user indicates if if the algorithm they want to use is a regression or classification algorithm. But sklearn has functionality to detect this automatically.

Thus, my idea is to remove this parameter from the classes in Feature-engine and instead use sklearn functions is_classifier and is_regressor, to detect this automatically. The functions can be found here: https://github.com/scikit-learn/scikit-learn/blob/95119c13af77c76e150b753485c662b7c52a41a2/sklearn/base.py#L771

Should be fairly easy (she said :p)

I would be very happy for you to give this one a go :)

solegalli avatar Apr 13 '21 11:04 solegalli

@solegalli Looking to contribute. Can I take this if available?

dataML007 avatar Jun 07 '21 21:06 dataML007

Hey @dataML007 yes, this one is still for the taking. It would be great to have your contribution :) thank you!

solegalli avatar Jun 08 '21 06:06 solegalli

Hey @dataML007 , @indymnv and @NicoGalli

Would any of you be able to pick up this issue?

It should be fairly straightforward :)

solegalli avatar Nov 16 '21 16:11 solegalli

@solegalli please assign it to me.

NicoGalli avatar Nov 16 '21 19:11 NicoGalli

assigned :p

solegalli avatar Nov 16 '21 20:11 solegalli

If no one is tackling this issue, I'll take it on.

Btw, be careful tossing around the term "straightforward"! Very few things are as straightforward as they seem ;p

Morgan-Sell avatar Dec 27 '21 23:12 Morgan-Sell

It would be great if you can pick this one up @Morgan-Sell :)

solegalli avatar Dec 28 '21 12:12 solegalli