-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
TransformedTargetRegressor returns the wrong _estimator_type with a classifier #15872
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
Comments
I suppose that this is the expected behavior, since as the name suggests, the |
Agreed. What's your use case for needing a TransformedTargetClassifier? What's your transformer? |
Since the use case here is "regression by classification" (something that @jnothman foreseen when developing the meta-estimator 👍 #9041 (comment)), it means that we want the estimator to be a classifier and apply a binarizer to transform the target. However, as I mentioned in #15850, we are still solving a regression problem and therefore the meta-estimator should use the default regression score and therefore should identify as a regressor. Therefore, with the current use case, I would close this issue. |
Description
TransformedTargetRegressor
returns the wrong_estimator_type
when a classifier is passed as the regressor parameter.Steps/Code to Reproduce
TransformedTargetRegressor(regressor=LogisticRegression())._estimator_type
Expected Results
'classifier'
Actual Results
'regressor'
Versions
System:
python: 3.7.2 (default, Jan 2 2019, 17:07:39) [MSC v.1915 64 bit (AMD64)]
executable: C:\Users\david\Anaconda3\envs\laserag_py37_skl0202\python.exe
machine: Windows-10-10.0.17763-SP0
Python dependencies:
pip: 18.1
setuptools: 41.0.1
sklearn: 0.22
numpy: 1.15.4
scipy: 1.1.0
Cython: 0.29.13
pandas: 0.25.1
matplotlib: 3.0.2
joblib: 0.14.0
Built with OpenMP: True
The text was updated successfully, but these errors were encountered: