-
-
Notifications
You must be signed in to change notification settings - Fork 26k
[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
Conversation
@@ -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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
)."?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@jnothman I have made the changes. Should I finally squash them? |
No, we squash upon merge. Squashing sooner only messes up reviewer tracking of changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
thx @SebastinSanty |
…n#9335) * AffinityPropagation damping factor not explained * Added for API also * Add equation for damping * formatting text * Add suggestions
…n#9335) * AffinityPropagation damping factor not explained * Added for API also * Add equation for damping * formatting text * Add suggestions
…n#9335) * AffinityPropagation damping factor not explained * Added for API also * Add equation for damping * formatting text * Add suggestions
…n#9335) * AffinityPropagation damping factor not explained * Added for API also * Add equation for damping * formatting text * Add suggestions
…n#9335) * AffinityPropagation damping factor not explained * Added for API also * Add equation for damping * formatting text * Add suggestions
…n#9335) * AffinityPropagation damping factor not explained * Added for API also * Add equation for damping * formatting text * Add suggestions
…n#9335) * AffinityPropagation damping factor not explained * Added for API also * Add equation for damping * formatting text * Add suggestions
…n#9335) * AffinityPropagation damping factor not explained * Added for API also * Add equation for damping * formatting text * Add suggestions
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