-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
multioutput problem #971
Comments
TPOT currently do not support multi-output regression and current configuration did not support more than one |
Do you know an alternative tool like TPOT that can do multi-output regression? Or a workaround? Like starting a loop with TPOT and changing each time the estimator? |
so using only the regressors that natively perform multi-output regression is not viable for now? because that seems to work already with some slight modifications (changing some sklearn metric iirc) |
Hmm, maybe it is practical workaround. Could you please share the modifications with a demo via pull request? |
Now I am a bit confused :) I already implemented the changes of base.py as suggested in #903 . So now I am already able to run TPOT with the regressors that natively perform multi-output regression. I didn't need to adjust metrics or whatever. Am I doing this wrong?? |
Sure, i'll look it up when i find the time. But i think there were no changes necessary in tpot directly, just a slight modification of a sklearn metric. Will post once i get around to it.
Yes that was my question. At least it works for those. |
I am still not getting it :)
since it already happened?
|
That pull request is not merged, so it is not native to TPOT and therefore unsupported. Also if there is a solution that does not require a flag, that would of course be better (again, i'm looking into it when i find the time). |
Yes, one of the reasons that we did not merge #903 is that we hoped there was a nice solution without the flag. I forgot to push a comment to that PR. |
Can someone confirm that changing this line: Line 1160 in aea42a5
to
multioutputs are supported correctly? It seems to work for me and was the only change i made, but i'd rather see it confirmed by someone before making a proper PR. edit: i just looked up the PR #903 and it seems to be doing the same change, albeit with a manual flag. |
Just found this thread myself, and I'm getting the same error as in #747 which is:
I know it's not officially supported, but would love to be able to use TPOT for a multi-output regression problem. For a simple reproducible problem, use this code:
How can we make this work? Hacky solutions are welcome! :D |
I am working on a multioutput regression problem, that is the target values have more than 1-dim.
A number of regressors from scikit-learn can only be used for multi output problems when used with the class MultiOutputRegressor (see especially https://scikit-learn.org/stable/modules/multiclass.html#multioutput-regression).
MultiOutputRegressor takes a regressor as an argument and fits then one regressor per target. In this way most single-output regressors can deal multidimensional output. So I want to use it with TPOT.
The issue #903 deals with the changes that must be applied to base.py (which I did and this worked fine) in order to work for multiple output. But neither in #747, #810 nor in #903 it was clarified how to actually use MultiOutputRegressor with several regressors.
This is my config dictionary:
custom_regressor_config_dict = { 'sklearn.multioutput.MultiOutputRegressor': { 'estimator': {'sklearn.linear_model.ElasticNetCV': { 'l1_ratio': np.arange(0.0, 1.01, 0.05), 'tol': [1e-5, 1e-4, 1e-3, 1e-2, 1e-1]}}}
Now I want to insert more regressors. But I tried to put them in a list or in dictionary and whatever, for example I tried
'sklearn.multioutput.MultiOutputRegressor': { 'estimator': [ {'sklearn.linear_model.ElasticNetCV': { 'l1_ratio': np.arange(0.0, 1.01, 0.05), 'tol': [1e-5, 1e-4, 1e-3, 1e-2, 1e-1]}}, {'sklearn.ensemble.AdaBoostRegressor': { 'n_estimators': [100], 'learning_rate': [1e-3, 1e-2, 1e-1, 0.5, 1.], 'loss': ["linear", "square", "exponential"]}} ] }
and it always throws an error like:
How to format it properly so that I can use more models? Is there a workaround? Thank you!
The text was updated successfully, but these errors were encountered: