Repository navigation
UMAP: pass compatibility_layout=True explicitly and record it (#644) - #648
Merged
Merged
Conversation
umap-learn 0.6 warns that the default of compatibility_layout will change. embedding._umap now passes compatibility_layout=False, the value is recorded as "compatibility_layout" in the settings of embed and find_populations, and the floor is umap-learn>=0.6. False changes the UMAP coordinates compared with earlier runs, and the populations found on them. Tests that guard the argument and the recorded setting are added; function_index.jsonl regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
Owner decision: pass compatibility_layout=True, so embeddings and populations are unchanged and no installed umap-learn default decides the layout. False split one Gaussian cloud into 41 HDBSCAN clusters and named no main population, so it is deferred until the populations are retuned with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
guijacquemet
marked this pull request as ready for review
November 26, 2026 06:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #644 (owner decision: pass the argument explicitly, with
Truefor now).What changed
embedding._umappassescompatibility_layout=Truetoumap.UMAPexplicitly (one constant,embedding.COMPATIBILITY_LAYOUT), for the maps' UMAP and the UMAP the populations (question 10) are clustered on.Trueis the umap-learn 0.5 layout and the 0.6 default; the value is now explicit, so a later umap-learn default cannot change them silently.compatibility_layoutin the settings ofembedandfind_populations, besiden_neighbors,min_distandrandom_state.umap-learn>=0.6.docs/common/function_index.jsonlregenerated.test_umap_is_built_with_compatibility_layout_explicitly(patchesumap.UMAP, asserts the kwarg is present andTrueat both call sites; fails if it is removed or differs),test_the_settings_record_the_umap_layout, andtest_the_settings_record_the_umap_layout_the_populations_were_found_on.lru_caches on statistics helpers), so nothing earlier can be reused. Nothing to fix.Why not
FalseyetWith
False(the layout umap-learn plans as its default), HDBSCAN split one cloud into 41 clusters and named no main population. Measured with umap-learn 0.6.0 on 2160 Gaussian cells plus a 240-cell separate blob:Truegives 2 clusters (2161 and 239 cells);Falsegives 41 (largest 358 cells, 300 unassigned). No cluster passesMAIN_SHARE0.5, so noP1is named; the 238-cell group is still found. Three existing population tests failed onFalsefor this reason and pass onTrue. The switch is deferred; revisitFalsetogether with retuning the populations.Golden outputs
None updated.
Tests run (umap-learn 0.6.0, Python 3.13)
ruff checkandruff format --check: clean.tools/audit.py --check-against origin/main: baselines only tightened.tools/check.pydoes not exist in this repository. The full suite was not run.🤖 Generated with Claude Code
https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a