I'd like to cluster points given to a custom distance and strangely, it seems that neither scipy nor sklearn clustering methods allow the specification of a distance function.
For instance, in sklearn.cluster.AgglomerativeClustering
, the only thing I may do is enter an affinity matrix (which will be very memory-heavy). In order to build this very matrix, it is recommended to use sklearn.neighbors.kneighbors_graph
, but I don't understand how I can specify a distance function either between two points. Could someone enlighten me?