Hi, I want to use clustering methods with precomputed distance matrix (NxN). I found DBSCAN has "metric" attribute but can't find examples to follow. Can you please help. Examples for other clustering methods are also very helpful. Thanks.
what part are you unclear about?
use metric="precomputed" and provide a as X a precomputed similarity matrix.
See http://scikit-learn.org/dev/auto_examples/manifold/plot_mds.html for an example using MDS.
no, it's not feasible algorithmically for k means
Can we change the type of distance to cosine similarity? Thanks!
no. We have a PR in the works for K medoid which is a related algorithm
that can take an arbitrary distance metric. Try it out: #7694. K means
needs to repeatedly calculate Euclidean distance from each point to an
arbitrary vector, and requires the mean to be meaningful; it cannot work
with a metric of your choice.
Most helpful comment
what part are you unclear about?
use metric="precomputed" and provide a as X a precomputed similarity matrix.
See http://scikit-learn.org/dev/auto_examples/manifold/plot_mds.html for an example using MDS.