Skip to content

Add 1D support to LearnerND#491

Open
basnijholt wants to merge 12 commits intomainfrom
issue-095-cleanup-py
Open

Add 1D support to LearnerND#491
basnijholt wants to merge 12 commits intomainfrom
issue-095-cleanup-py

Conversation

@basnijholt
Copy link
Copy Markdown
Member

Closes ISSUE-095

basnijholt and others added 12 commits April 5, 2026 01:29
Remove the dim==1 guard in Triangulation and add 1D initialization
that sorts points and creates interval simplices. Fix
simplex_volume_in_embedding for line segments, add interp1d-based
interpolation for 1D LearnerND, and add 1D plot support.

Also fix DataSaver's _to_key to handle LearnerND's tuple keys for
1D points, and fix positional indexing in load_dataframe (iloc).

Includes comprehensive tests: 8 dedicated 1D triangulation tests,
6 unit LearnerND tests, 4 integration tests, dim=1 added to 8
existing parametrized tests, and a 1D function registered for
cross-learner tests.
1. Fix 1D plot() crash: flatten ((x,), y) tuples to (x, y) for
   np.array compatibility in Scatter data.

2. Fix 1D _ip() for vector outputs: pass axis=0 to interp1d so
   R^1 -> R^M functions interpolate correctly.

3. Fix duplicate 1D coordinates: skip adjacent duplicates after
   sorting to avoid degenerate zero-volume simplices.

4. Fix flaky test_circumsphere for dim=1: special-case dim==1 to
   generate center ± radius deterministically instead of Gaussian
   sampling that can place both points on the same side.

Adds regression tests for all four issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant