umap-js
umap-js copied to clipboard
Feature Request: Accept custom distance function based on labels
I have a distance matrix precalculated for each pair of labels, and I would like to pass that distance instead of eucliden
or some other method.
It will e helpful if the distanceFn
accepts a function that takes two labels as arguments and return the distance.
You can already do this. See this example: https://observablehq.com/@fil/umap-simple-topologies
Hi @zdk123,
Thank you for this. But I needed the distanceFn
to be invoked using the labels instead of indices for supervised projection. I created a workaround in my local by mapping labels to indices.