tpot icon indicating copy to clipboard operation
tpot copied to clipboard

Can I use TransformedTargetRegressor in tpot?

Open hanshupe opened this issue 3 years ago • 1 comments

In some cases transforming the target will improve the prediction drastically for regression problems (see: https://scikit-learn.org/stable/auto_examples/compose/plot_transformed_target.html)

Can I use the sklearn.compose.TransformedTargetRegressor step in a tpot pipeline, so that it transforms the target accordingly, but evaluates the predictions after applying the inverse_transform? Also the final predictions should be retransformed by inverse_transform.

hanshupe avatar Apr 22 '21 08:04 hanshupe

Looks like that works:

        'sklearn.compose.TransformedTargetRegressor': {
            'regressor': {
                'sklearn.linear_model.LinearRegression': {
                    'normalize': [True, False],
                    'copy_X': [True] }
            },
            'func': {'numpy.log': None}, 'inverse_func': {'numpy.exp': None}
            },

Is there a way to include a list of regressors?

hanshupe avatar Apr 22 '21 21:04 hanshupe