Skip to content

MNT Remove deprecated entropy from sklearn.metrics.cluster - #35253

Merged
lesteve merged 3 commits into
scikit-learn:mainfrom
blank-0007:mnt-remove-cluster-entropy
Nov 2, 2026
Merged

lesteve merged 3 commits into
scikit-learn:mainfrom
blank-0007:mnt-remove-cluster-entropy

Conversation

@blank-0007

@blank-0007 blank-0007 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Part of #35252

What does this implement/fix? Explain your changes.

This PR carries out the scheduled deprecation removal of entropy from sklearn.metrics.cluster for the 1.10 release cycle:

  • Removed public entropy function from sklearn/metrics/cluster/_supervised.py (deprecated in 1.8).
  • Retained the private _entropy function, which is used internally by clustering evaluation metrics.
  • Removed entropy from sklearn/metrics/cluster/__init__.py and __all__.
  • Removed test_public_entropy_deprecation from sklearn/metrics/cluster/tests/test_supervised.py.
  • Removed the now-unused deprecated import in _supervised.py.
  • Added the towncrier news fragment in doc/whats_new/upcoming_changes/sklearn.metrics/35253.api.rst.

Introduce yourself

Hi everyone! My name is Kaushal. I'm a student and open-source enthusiast interested in machine learning and data science. I regularly use scikit-learn in my learning and projects, and I wanted to start contributing to the community by helping with the maintenance and deprecation cleanups for the upcoming 1.10 release. Looking forward to learning from the community and addressing any review feedback!

AI usage disclosure

I used AI assistance for:

  • Research and understanding
  • Code generation (e.g., when writing an implementation or fixing a bug)

Any other comments?

None.

@github-actions

Copy link
Copy Markdown

Thank you for opening your first pull request to scikit-learn! 🎉

To help get your contribution reviewed, please make sure that:

  • You have filled out the pull request template.

  • The pull request addresses an existing issue that is ready for contribution (e.g. not tagged as 'Needs Triage', 'Needs Decision', ...). If you are proposing a new feature, please open an issue to discuss it first.

  • There are no other open pull requests already targeting the same issue.

  • You have followed the pull request checklist. In particular, linting and tests should pass.

@github-actions github-actions Bot added the CI:Linter failure The linter CI is failing on this PR label Oct 28, 2026
@lesteve

lesteve commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Glad to see you are interested to contribute to scikit-learn 🙏!

I would suggest you have a look at our contributing doc and in particular the section Issues for new contributors.

I edited your PR description to link to the relevant issue #35120.

Please fill out the PR description to give us some hints that you are a human, in particular the "introduce yourself" section.

Also the CI is failing at the linting step, which means that you need to fix it look at the message comment above #35253 (comment).

You can also have a look at GitHub's How to contribute to Open-Source guide, which gives a good generic overview about how open-source works.

@github-actions github-actions Bot removed the CI:Linter failure The linter CI is failing on this PR label Oct 29, 2026
@blank-0007

Copy link
Copy Markdown
Contributor Author

Hi @lesteve! Thank you for the guidance and pointers 🙏.

I've updated the PR description with an introduction and the AI usage disclosure. I also removed the unused deprecated import in _supervised.py, formatted the file, and renamed the news fragment to match the PR number (35253.api.rst). The lint checks should now pass.

Please let me know if there are any other changes needed!

@AnneBeyer

Copy link
Copy Markdown
Member

Hi @blank-0007, thank you for the PR and for updating the description.
One small thing: We don't usually add a changelog entry for the removal, this is only added for the deprecation (which was done in #31294).
Once you remove the changelog entry, this is ready to be merged.

@blank-0007

Copy link
Copy Markdown
Contributor Author

Hi @AnneBeyer, thanks for the review!

I've removed the changelog entry file as requested and pushed the update. Everything should be good to go now!

@AnneBeyer AnneBeyer 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 now.

@cakedev0 cakedev0 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, let's merge.

@lesteve
lesteve merged commit c62d980 into scikit-learn:main Nov 2, 2026
38 checks passed
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