Open JohnTigue opened 4 years ago
umap-js has custom distance functions since 2019-06.
[E.g. of asyn fitting]():
import { UMAP } from 'umap-js';
const umap = new UMAP();
const embedding = await umap.fitAsync(data, epochNumber => {
// check progress and give user feedback, or return `false` to stop
});
Or step-by-step:
import { UMAP } from 'umap-js';
const umap = new UMAP();
const nEpochs = umap.initializeFit(data);
for (let i = 0; i < nEpochs; i++) {
umap.step();
}
const embedding = umap.getEmbedding();
The custom distance function in this case is one that changes during the development of the embedding, as the user sets the tree of focuses. Each newly set focus is another change in the distance function as some region gets fisheye zoomed.