Skip to content

ENH: Display fitted attributes in HTML representation - #33399

Merged
ogrisel merged 143 commits into
scikit-learn:mainfrom
DeaMariaLeon:fitted-att-noempty
Mar 9, 2026
Merged

ogrisel merged 143 commits into
scikit-learn:mainfrom
DeaMariaLeon:fitted-att-noempty

Conversation

@DeaMariaLeon

@DeaMariaLeon DeaMariaLeon commented Feb 24, 2026 •

Copy link
Copy Markdown
Member

Reference Issues/PRs

Supersedes #31442
See #31442 (comment)

Towards #26595

Friendly ping to @jeremiedbb @antoinebaker

What does this implement/fix? Explain your changes.

I put the information in 3 columns.
I was going to (try) to modify or remove ndarray or try to show it "prettier" but I'm actually not sure if this is what you meant.

Screenshot 2026-02-24 at 15 09 16

AI

usage disclosure

I used AI assistance for:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation -> checked for vulnerabilities on estimator.py - EDIT: I didn't add code related to this check for the moment.
  • Documentation (including examples)
  • Research and understanding

Any other comments?

Comment thread sklearn/base.py Resolved
Comment thread sklearn/base.py Resolved

@ogrisel ogrisel 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!

@DeaMariaLeon

Copy link
Copy Markdown
Member Author

Thank you so much!! 🪅 🥳

@antoinebaker antoinebaker 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.

Here a first pass @DeaMariaLeon , mostly nits and typos ! The rendering looks good.

Side remark not related to this PR

The link to the fitted attribute docstring looks a bit ugly due to the text fragment anchor, for example:
https://scikit-learn.org/dev/modules/generated/sklearn.linear_model.LogisticRegression.html#:~:text=classes_,-ndarray%20of%20shape%20%28n_classes%2C%20%29
Ideally setting an id for each attribute doctring could be nice, on the previous example:
https://scikit-learn.org/dev/modules/generated/sklearn.linear_model.LogisticRegression.html#classes
Maybe we could start a separate issue/PR to improve generate_link_to_param_doc?

Comment thread sklearn/base.py Resolved
Comment thread sklearn/base.py Resolved
Comment thread sklearn/base.py Resolved
Comment thread sklearn/base.py Resolved
Comment thread sklearn/compose/_column_transformer.py Resolved
Comment thread sklearn/tests/test_base.py Resolved
Comment thread sklearn/utils/_repr_html/estimator.py Resolved

@antoinebaker antoinebaker 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.

A few nitpicks but LGTM ! Thanks again @DeaMariaLeon.

Comment on lines +6 to +7
By :user:`Dea María Léon <DeaMariaLeon>`,
:user: `Jérémie du Boisberranger <jeremiedbb>`.

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.

Suggested change
By :user:`Dea María Léon <DeaMariaLeon>`,
:user: `Jérémie du Boisberranger <jeremiedbb>`.
By :user:`Dea María Léon <DeaMariaLeon>` and :user: `Jérémie du Boisberranger <jeremiedbb>`.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for all the feedback... in this particular case, I had just added everybody. I hope it's OK:

Screenshot 2026-03-09 at 11 17 34

Comment thread sklearn/utils/_repr_html/estimator.py Resolved
@DeaMariaLeon

Copy link
Copy Markdown
Member Author

I think I implemented all the feedback up to now. Thanks everybody.

@ogrisel
ogrisel merged commit ceeffc5 into scikit-learn:main Mar 9, 2026
32 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in Labs Mar 9, 2026
@ogrisel

ogrisel commented Mar 9, 2026

Copy link
Copy Markdown
Member

Merged! Thank you very much @DeaMariaLeon and all reviewers!

@ogrisel

ogrisel commented Mar 9, 2026 •

Copy link
Copy Markdown
Member

@DeaMariaLeon I now realize that we should have triggered a full doc build with a last commit with [doc build] somewhere in the commit message to run all the examples before merging. Let's check if the doc CI does not fail in main in the coming hour:

https://app.circleci.com/pipelines/github/scikit-learn/scikit-learn/76730/workflows/f4fd4362-8f36-48ca-9705-0dc31aa36fa1

@DeaMariaLeon

DeaMariaLeon commented Mar 9, 2026 •

Copy link
Copy Markdown
Member Author

@DeaMariaLeon
DeaMariaLeon deleted the fitted-att-noempty branch March 9, 2026 17:00
@ogrisel

ogrisel commented Mar 9, 2026

Copy link
Copy Markdown
Member

My point was to push a final commit in the PR to trigger the build of all the gallery examples in scikit-learn (which typically nearly 1h) to check that merging it will not risk making one of them fail and failing the Circle CI of subsequent PR branched of off main after the merge.

But fortunately it's green on main. Let's keep that in main for the next PR.

@DeaMariaLeon

Copy link
Copy Markdown
Member Author

Sorry about the misunderstanding. I see what you mean.

There is a CI test failure but it doesn't seem to be related to this pr https://github.com/scikit-learn/scikit-learn/actions/runs/22860215196/job/66311978573

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants