Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH Set Affinity propagation labels if any clusters were found - #22217

Merged
thomasjpfan merged 11 commits into
scikit-learn:mainfrom
Micky774:affinity_propagation_labels
Feb 2, 2022
Merged

ENH Set Affinity propagation labels if any clusters were found#22217
thomasjpfan merged 11 commits into
scikit-learn:mainfrom
Micky774:affinity_propagation_labels

Conversation

@Micky774

@Micky774 Micky774 commented Jan 15, 2022

Copy link
Copy Markdown
Contributor

Reference Issues/PRs
Fixes #17657

What does this implement/fix? Explain your changes.
Current plan is to change behavior so that regardless of convergence, AffinityPropagation returns its generated cluster centers (if any) and labels. To do this I will change documentation (and warnings) to emphasize that un-converged results may be degenerate and should be accepted at the user's own risks.

Any other comments?
Open to suggestions on behavior changes

- Changed behavior to output any clusters/labels generated
even if not fully converged
- Modified documentation to reflect this behaviour
@Micky774 Micky774 changed the title [WIP] Affinity propagation labels ENH Affinity propagation labels Jan 15, 2022

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

Thanks for the PR @Micky774 ! Implementation looks good. I left a comment about backward compatible for core-devs to decide on.

Comment thread sklearn/cluster/tests/test_affinity_propagation.py
@thomasjpfan

Copy link
Copy Markdown
Member

For the time being, we can add a whats new so changelog test passes.

@Micky774

Micky774 commented Jan 18, 2022

Copy link
Copy Markdown
Contributor Author

For the time being, we can add a whats new so changelog test passes.

Done. I added it under v1.1. What is the default version to add updates to? Or rather, how can I determine it.

@thomasjpfan

Copy link
Copy Markdown
Member

Done. I added it under v1.1. What is the default version to add updates to? Or rather, how can I determine it.

It's almost always the next minor release, which is currently 1.1. The only entries that go into 1.0 after 1.0 is released are bug fixes.

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

I'm ok with the backward incompatible change. It's what we agreed on in the issue.

LGTM. Thanks @Micky774 !

Comment thread sklearn/cluster/tests/test_affinity_propagation.py Outdated
@Micky774

Micky774 commented Feb 1, 2022

Copy link
Copy Markdown
Contributor Author

@thomasjpfan Just wanted to see if there were any other revisions you'd like to see, or if this is ready to merge

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

Minor suggestion for the whats new. otherwise LGTM!

Comment thread doc/whats_new/v1.1.rst Outdated
@thomasjpfan thomasjpfan changed the title ENH Affinity propagation labels ENH Set Affinity propagation labels if any clusters were found Feb 1, 2022
Co-authored-by: Thomas J. Fan <[email protected]>
@thomasjpfan
thomasjpfan merged commit 27dda7a into scikit-learn:main Feb 2, 2022
@Micky774
Micky774 deleted the affinity_propagation_labels branch February 2, 2022 21:29
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Feb 9, 2022
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.

Affinity Propagation fails on the datasets that were clusterable in version 21.3

3 participants