AlignedUMAP ignores n_components parameter
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.3k
- Forks
- 871
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 5
Description
Hi,
AlignedUMAP produces a sequence of 2-dimensional embeddings regardless of the n_components' parameter value.
Here's some code taken from this page to demonstrate this.
import numpy as np
import sklearn.datasets
import umap
import umap.plot
import umap.utils as utils
import umap.aligned_umap
digits = sklearn.datasets.load_digits()
ordered_digits = digits.data[np.argsort(digits.data.sum(axis=1))]
ordered_target = digits.target[np.argsort(digits.data.sum(axis=1))]
slices = [ordered_digits[150 * i:min(ordered_digits.shape[0], 150 * i + 400)] for i in range(10)]
relation_dict = {i+150:i for i in range(400-150)}
relation_dicts = [relation_dict.copy() for i in range(len(slices) - 1)]
aligned_mapper_3D = umap.AlignedUMAP(n_components=3).fit(slices, relations=relation_dicts)
aligned_mapper_3D.embeddings_[0].shape
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the example from aligned_umap_basic_usage.html with umap.AlignedUMAP(n_components=3), then inspect the umap.AlignedUMAP entry point and how embeddings_ is produced. Done means embeddings_[0] and the other aligned embeddings use the requested component count rather than always having two dimensions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python, scikit-learn
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100