Skip to content

show transformed data not dataop itself in fit report#1623

Merged
rcap107 merged 4 commits into
skrub-data:mainfrom
jeromedockes:dop-fit-report
Sep 22, 2025
Merged

show transformed data not dataop itself in fit report#1623
rcap107 merged 4 commits into
skrub-data:mainfrom
jeromedockes:dop-fit-report

Conversation

@jeromedockes

Copy link
Copy Markdown
Member

The learner.report(env, mode="fit") currently shows for each node the dataop itself, rather than the intermediate result (eg as fit_transform would)

for example

from sklearn.ensemble import HistGradientBoostingRegressor
from sklearn.dummy import DummyRegressor
import skrub
from skrub import datasets

data = skrub.var("data")
X = data.skb.drop("current_annual_salary").skb.mark_as_X()
y = data["current_annual_salary"].skb.mark_as_y()
hgb = X.skb.apply(skrub.TableVectorizer()).skb.apply(
    HistGradientBoostingRegressor(), y=y
)
dummy = X.skb.apply(DummyRegressor(), y=y)
learner = (
    skrub.choose_from({"hgb": hgb, "dummy": dummy}, name="model")
    .as_data_op()
    .skb.make_learner()
)

df = datasets.fetch_employee_salaries().employee_salaries
learner.report(environment={"data": df}, mode="fit")
learner.report(environment={"data": df}, mode="fit_transform")

For the first report ("fit") in the main branch the (wrong) displayed output is the display of the intermediate data op itself:

image

In the fixed report it is the actual output of this step:

image

(note the output of the final supervised estimator in "fit" mode is the estimator itself -- but not the dataop)

image

@jeromedockes jeromedockes added bug Something isn't working data_ops Something related to the skrub DataOps labels Sep 19, 2025
@jeromedockes jeromedockes added this to the 0.6.2 milestone Sep 19, 2025

@rcap107 rcap107 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @jeromedockes

@rcap107 rcap107 merged commit d295332 into skrub-data:main Sep 22, 2025
26 checks passed
rcap107 pushed a commit to rcap107/skrub that referenced this pull request Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working data_ops Something related to the skrub DataOps

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants