James Melville

I think about dimensionality reduction a lot.

I wrote and maintain uwot, an implementation of UMAP in R and C++. If you’ve made a UMAP plot of single-cell data with Seurat, you’ve probably used it.

I coauthored the second version of the UMAP paper with Leland McInnes and John Healy. I was trying to work out how UMAP differed from t‑SNE, so I read the Python code and asked Leland about the bits I couldn’t follow.

Selected writing

UMAP for t‑SNE users

What changes between t‑SNE and UMAP? I start with the similarities each method calculates and work through to the code that moves the points.

Perplexity and intrinsic dimensionality

I worked out an analytical version of Lee and co-workers’ estimate of local dimension. It comes almost for free with the perplexity calculations t-SNE already does. Practically speaking it was doomed, but I made a lot of charts and now I’m going to show them to you.

Nesterov momentum

Several different-looking updates ought to give the same answer. Checking that took a bit of working out.

A few experiments

Software

Run UMAP in R
uwot fits embeddings, works with labels and projects new observations into an existing embedding.
Find nearest neighbors
rnndescent works with dense and sparse data. RcppHNSW brings hnswlib to R. Both can supply neighbors to uwot.
Compare embeddings
I use smallvis to change one thing at a time in R. For larger 2D embeddings, its C++ code can approximate the repulsive forces with FFT interpolation, a Barnes–Hut tree or a mutual tree. In Python I use drnb to compare methods on the same datasets. Try the force comparison.
Test an embedding
I get datasets like Fashion-MNIST from snedata and plot the 2D coordinates with vizier. With quadra I can check how many of each point’s original neighbors are still nearby.
Optimize an objective
mize implements unconstrained optimizers in R. Its sibling funconstrain gives me 35 test problems from Moré, Garbow and Hillstrom to try them on.
Prepare a CRAN release
I built revdeprunner around r-lib’s revdepcheck to smooth out a few rough edges in my own releases. I can see what needs building before I start checking the packages that depend on mine. It’s also my first entirely vibe-coded package.

More to read

Current interests

Can the Codex skills I use on my projects get better with experience? I can’t afford a big suite of evals, so in codex-workflows I’m borrowing an idea from agile development. Alongside skills for jobs like editing a vignette, there are skills for running retrospectives. Agents look back at a task, decide what’s worth changing in the skills they used, and check on later tasks whether it helped.