Skip to content

agglomerative clustering documentation #13119

Closed

Description

@yvanlucas

Dear all,

First, thanks for the wonderful work!

When I read the documentation ( https://scikit-learn.org/stable/modules/generated/sklearn.cluster.AgglomerativeClustering.html#sklearn.cluster.AgglomerativeClustering ) about agglomerative clustering using the affinity : "precomputed", it is not written if the matrix provided is supposed to be a distance matrix or a similarity matrix (which are "inverses").

After some reads and tries I believe the matrix given behave as a distance matrix.

I think that It would be suitable to add this information: for example, this:

affinity : string or callable, default: “euclidean”
Metric used to compute the linkage. Can be “euclidean”, “l1”, “l2”, “manhattan”, “cosine”, or ‘precomputed’. If linkage is “ward”, only “euclidean” is accepted. If 'precomputed' a distance matrix is needed as input for the fit method.

instead of this:

affinity : string or callable, default: “euclidean”
Metric used to compute the linkage. Can be “euclidean”, “l1”, “l2”, “manhattan”, “cosine”, or ‘precomputed’. If linkage is “ward”, only “euclidean” is accepted.

Best regards and thanks for your wonderful work! =)

Activity

  1. adrinjalali commented on Feb 9, 2019

    @adrinjalali
    Member

    To be fair, all other mentioned possible values (euclidean for instance) are distance metrics. Therefore I'd assume it would be relatively clear that the method expects a distance metric. Anyhow, if we decide to change anything, it should be changed in all places where we take a distance/affinity function as input.

    Having a glance at the hierarchical.py itself, I can see there are quite a few different versions we have there.

    As a side note, the term affinity may be confusing for some people when used as a distance measure instead of similarity.

  2. jnothman commented on Feb 11, 2019

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions