By knowing each data point's coordinate, it is easy to apply them with clustering methods as k-means etc. By if the case is we only know the distances between each pair of data points without knowing the definite location coordinate of every data point, is it possible to apply any clustering methods in this case?
2 Answers
K-Medoids
It would be possible with an adapted semi-supervised K-Means, also known as K-Medoids.
The tricky part with K-Means is that you do not know the centroids. However, you could hot start by assuming that some of your data points are centroids. Then, when figuring the new centroid at each iteration, instead of figuring out the "imaginary" central position, pick the point in the cluster that minimizes the sum to all other points in the cluster.
Hierarchical Clustering
You could also try a hierarchical clustering method. One example is the AgglomerativeClustering from Scikit-Learn. The idea is that you start merging points that minimize their linkage distance. Then, there is a certain criteria for determining points that are "too far away" and a new cluster should be created.
This is the fit()
method documentation. Notice how you can either pass the instance features or the distance matrix between instances.

- 3,548
- 1
- 12
- 36
-
Your "adapted $k$-means" sounds vaguely similar to a $k$-medoids algorithm. – Ilmari Karonen Dec 29 '19 at 17:48
-
@IlmariKaronen you are totally right! I will change the name. Thank you for contributing :) – Bruno Lubascher Dec 30 '19 at 07:38
Yes it is possible however not all algorithms support this. For example, k-means will not be able to do this, because k-means use centroid which is an "imaginary" point on the space, hence inferring distance from this point to another point on the dataset is not possible without knowing the location of every datapoints. On the other hand, DBScan is able to do this, because this algorithm essentially perform union of set of points that are close to each other.
In general, you might want to understand roughly how each algorithm work to "guess" whether this behaviour is supported. You can also check the documentation for example sklearn's documentation.

- 1,123
- 7
- 15
-
Would you please give me a linkage to the wiki or paper of "DBScan" that you mentioned? – piratesailor Dec 29 '19 at 15:32
-
you can check on wikipedia. They have a good amount of information on the page for dbscan – Yohanes Alfredo Dec 30 '19 at 01:05