Skip to content
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

Have distinct problem for single-output regression and multi-output regression #1005

Closed
glemaitre opened this issue Dec 23, 2024 · 2 comments · Fixed by #1305
Closed

Have distinct problem for single-output regression and multi-output regression #1005

glemaitre opened this issue Dec 23, 2024 · 2 comments · Fixed by #1305
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@glemaitre
Copy link
Member

Right now, when detecting the ML task, we return a "regression" string for both single- and multi-output regression.

However, with EstimatorReport and some plotting it might not be straightforward to support multi-output regression out of the box. It could be handy to distinguish both to provide a fine grain solution in the different tools.

@MarieSacksick MarieSacksick added the enhancement New feature or request label Dec 23, 2024
@auguste-probabl auguste-probabl self-assigned this Jan 28, 2025
@auguste-probabl
Copy link
Contributor

I can't reproduce the behaviour:

>>> from skore.sklearn.find_ml_task import _find_ml_task

>>> import numpy

# single-output regression
>>>  _find_ml_task(numpy.array([0.5,2]))
'regression'

# multi-output regression
>>>  _find_ml_task(numpy.array([[0.5,2],[3,2],[3,1]]))
'unknown'

@MarieSacksick
Copy link
Contributor

This code:

from sklearn.datasets import make_regression
from sklearn.linear_model import LinearRegression
from skore import EstimatorReport

X, y = make_regression(n_targets=2)
estimator = LinearRegression()
report = EstimatorReport(estimator, X_train=X, y_train=y, X_test=X, y_test=y)
report._ml_task

outputs "regression".

And with scikit-learn:
Image

So there are two tasks in this issue actually:

  • fix find_ml_task which doesn't find the correct target
  • upgrade find_ml_task to have both multioutput regression et single output regression to make sure the correct plots are displayed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants