I would like the points of the clusters to be set at an arbitrary distance, and, oddly enough, it seems that neither the scipy nor sklearn clustering methods allow specifying a remote function.
For example, in sklearn.cluster.AgglomerativeClustering only thing I can do is enter an affinity matrix (which will be very hard for memory). To build this matrix itself, it is recommended to use sklearn.neighbors.kneighbors_graph , but I donβt understand how to specify the distance function between two points. Can anyone enlighten me?
python scipy scikit-learn hierarchical-clustering
Mark morrisson
source share