Skip to content

ENH: update html parameter display to match scikit-learn style#504

Draft
AnimeshPatra2005 wants to merge 2 commits intosktime:mainfrom
AnimeshPatra2005:enh/html-param-display-503
Draft

ENH: update html parameter display to match scikit-learn style#504
AnimeshPatra2005 wants to merge 2 commits intosktime:mainfrom
AnimeshPatra2005:enh/html-param-display-503

Conversation

@AnimeshPatra2005
Copy link

Reference Issues/PRs

Closes #503. Related to sktime/sktime#9497.

What does this implement/fix? Explain your changes.

scikit-learn has updated how they display parameters in the HTML representation of estimators. This PR updates scikit-base to match.

Previously, clicking an estimator box in a Jupyter notebook showed a raw <pre> string like MyEstimator(alpha=0.5).

This PR replaces that with a structured two-column parameter table built from get_params(deep=False), showing each parameter name and its current value in a cleaner, more readable format.

Changes:

  • New _params_to_html_table() helper that generates the table HTML
  • _write_label_html() gains an optional estimator parameter; when provided, renders the table instead of the pre block
  • _write_base_object_html() passes the estimator through
  • CSS styles for the table appended to _STYLE

Does your contribution introduce a new dependency? If yes, which one?

No.

What should a reviewer concentrate their feedback on?

  • The CSS styling choices for the parameter table
  • Whether the fallback to <pre> for non-estimator objects is correct

Any other comments?

Marked as Draft, happy to add unit tests once the approach is confirmed as the right direction.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH] update html parameter display to match scikit-learn style

1 participant