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

Skip to content

[MRG+1] AffinityPropagation damping factor not explained #9335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 13, 2017

Conversation

SebastinSanty
Copy link
Contributor

Reference Issue

Fixes #9333

What does this implement/fix? Explain your changes.

Add description about damping in AffinityPropagation in the API and User Guide docs.

Any other comments?

No

@@ -301,7 +301,9 @@ is given.
Affinity Propagation can be interesting as it chooses the number of
clusters based on the data provided. For this purpose, the two important
parameters are the *preference*, which controls how many exemplars are
used, and the *damping factor*.
used, and the *damping factor* which damps the responsibility and
availability messages to avoid numerical oscillations when updating these
Copy link
Member

Choose a reason for hiding this comment

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

can it be included in the equations below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.

As discussed above, in order to avoid numerical oscillations when updating the
messages, the damping factor :math:`\lambda` is introduced to iteration process:

.. math:: r_{t+1}(i, k) = \lambda\cdot r_{t}(i, k) + (1-\lambda)\cdot r_{t+1}(i, k)
Copy link
Member

Choose a reason for hiding this comment

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

So to be sure, this means the previous value has to contribute at least half of the new value relative to the incoming message, but can contribute more. Yes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure about that. Paper just mentions that damping factor should be between 0 and 1. But, according to scikit's API documentation, yes.

@@ -197,7 +197,10 @@ class AffinityPropagation(BaseEstimator, ClusterMixin):
Parameters
----------
damping : float, optional, default: 0.5
Damping factor between 0.5 and 1.
Damping factor (between 0.5 and 1) damps the
Copy link
Member

Choose a reason for hiding this comment

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

How about "Damping factor (between 0.5 and 1) is the extent to which the current value is maintained relative to incoming values (weighted 1 - damping)."?

Copy link
Contributor Author

@SebastinSanty SebastinSanty Jul 12, 2017

Choose a reason for hiding this comment

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

Yes, that explains damping better. Should I add that to both API doc and User guide?

Copy link
Member

Choose a reason for hiding this comment

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

Definitely here; user guide says the same in math. Do what you would find helpful as a user.

@SebastinSanty
Copy link
Contributor Author

@jnothman I have made the changes. Should I finally squash them?

@jnothman
Copy link
Member

No, we squash upon merge. Squashing sooner only messes up reviewer tracking of changes.

Copy link
Member

@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

LGTM

@jnothman jnothman changed the title [MRG] AffinityPropagation damping factor not explained [MRG+1] AffinityPropagation damping factor not explained Jul 13, 2017
@agramfort agramfort merged commit 8bb764c into scikit-learn:master Jul 13, 2017
@agramfort
Copy link
Member

thx @SebastinSanty

@SebastinSanty SebastinSanty deleted the sprint branch July 13, 2017 15:45
jnothman pushed a commit to jnothman/scikit-learn that referenced this pull request Aug 6, 2017
…n#9335)

* AffinityPropagation damping factor not explained

* Added for API also

* Add equation for damping

* formatting text

* Add suggestions
dmohns pushed a commit to dmohns/scikit-learn that referenced this pull request Aug 7, 2017
…n#9335)

* AffinityPropagation damping factor not explained

* Added for API also

* Add equation for damping

* formatting text

* Add suggestions
dmohns pushed a commit to dmohns/scikit-learn that referenced this pull request Aug 7, 2017
…n#9335)

* AffinityPropagation damping factor not explained

* Added for API also

* Add equation for damping

* formatting text

* Add suggestions
NelleV pushed a commit to NelleV/scikit-learn that referenced this pull request Aug 11, 2017
…n#9335)

* AffinityPropagation damping factor not explained

* Added for API also

* Add equation for damping

* formatting text

* Add suggestions
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
…n#9335)

* AffinityPropagation damping factor not explained

* Added for API also

* Add equation for damping

* formatting text

* Add suggestions
AishwaryaRK pushed a commit to AishwaryaRK/scikit-learn that referenced this pull request Aug 29, 2017
…n#9335)

* AffinityPropagation damping factor not explained

* Added for API also

* Add equation for damping

* formatting text

* Add suggestions
maskani-moh pushed a commit to maskani-moh/scikit-learn that referenced this pull request Nov 15, 2017
…n#9335)

* AffinityPropagation damping factor not explained

* Added for API also

* Add equation for damping

* formatting text

* Add suggestions
jwjohnson314 pushed a commit to jwjohnson314/scikit-learn that referenced this pull request Dec 18, 2017
…n#9335)

* AffinityPropagation damping factor not explained

* Added for API also

* Add equation for damping

* formatting text

* Add suggestions
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.

AffinityPropagation damping factor not explained
3 participants