lmcinnes / lmcinnes/umap

AlignedUMAP: transform new observations

Open
#960 2 comments 1 reaction 0 assignees View on GitHub
new feature
Dominant language
Python
Stars
8.3k
Forks
871
Avg merge
1d 13h
Merged PRs (30d)
5

Description

Hi,

I was wondering if it is possible to transform new observations into the aligned embedding space.

Ideally, I would like to:

* Use AlignedUMAP on dataset A and B (let's assume they have the same number of samples), with their corresponding relations (which is a 1:1 map... e.g. 0 -> 0, 1 -> 1, etc).

* When I get a new sample for either A or B, I would like to transform the new sample to the aligned space.

* Also, I would like to be able to back transform the new embedding to either of the original spaces (A or B)

I was hoping to do something like:

```python
aligned_mapper = umap.AlignedUMAP(n_components=1000, target_metric='l1').fit([A, B], relations=relations)
emb = aligned_mapper.mappers_[0].transform(new_A)
back_A = aligned_mapper.mappers_[0].inverse_transform(emb)
back_B = aligned_mapper.mappers_[1].inverse_transform(emb)
```

but I realised that there are a bunch of steps after fitting each mapper (e.g.: `procrustes_align`).

Is it even possible to do this?

Cheers!

Contributor guide

Open the contributing guide

Research direction

Start with the AlignedUMAP API and the mappers_, transform, inverse_transform, and procrustes_align entry points shown in the issue. Trace how individual mapper embeddings are aligned after fitting, then determine the scope needed for transforming new observations and inverse-transforming them across the aligned spaces. Done means the requested A/B workflow is supported or its limitations are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.