uwot icon indicating copy to clipboard operation
uwot copied to clipboard

Sample weights

Open ilyakorsunsky opened this issue 4 years ago • 1 comments

I am curious to see whether there is a way to give individual observations different weights in the UMAP objective function. For instance, I have data from 2 conditions, one with 100 observations and one with 1000. I would like to have both conditions contribute equally to the embedding. Perhaps naively, I would expect observations from each conditions to take up the same amount of real estate in this balanced analysis. I appreciate any thoughts on how feasible this would be. Thanks in advance!

ilyakorsunsky avatar Dec 10 '19 15:12 ilyakorsunsky

@ilyakorsunsky, it's an interesting question. Assuming your example is loosely based on real data you're working with, is the issue that you are seeing the data from the smaller subset (let's call it condition100) is being poorly clustered or is it forming a much smaller, denser cluster than condition1000? Assuming the underlying data has come cluster structure, although UMAP is insensitive to differences in data densities, it is affected by differences in the number of data points in each cluster -- the more data there is, the larger the cluster will be.

In general, most parts of UMAP are driven by interactions between pairs of points, so it's hard to intervene using a point-wise weighting. There is an (abitrary as far as I know) normalization factor when the smoothed knn distances are calculated, where it might be possible to do something, but I am wildly speculating at this point and would have to experiment.

For the general case, I would recommend opening an issue at https://github.com/lmcinnes/umap as Leland and other UMAP users may have already had thoughts on this.

jlmelville avatar Dec 10 '19 17:12 jlmelville