Make native NNS distance the default (dist=None) and propagate through stack/boost, add tests - #125
Merged
OVVO-Financial merged 1 commit intoJul 16, 2026
Conversation
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.
Motivation
dist, preserving the historical / documented native behavior.nns_reg,nns_m_reg,nns_stack,nns_boost) and internal engines so ensemble and forecasting code use the intended metric."L1","L2","FACTOR") supported.Description
dist: str | None = Nonefornns_reg,nns_m_reg,nns_stack, andnns_boostand updated internal dispatch to treatNoneas the native"NNS"alias via_validate_dist._mreg_distancesassum(abs(z) + z**2, axis=2)and updated prediction/score paths to supportdist == "NNS".distvalues throughnns_boost/nns_stackso learner trials and final stacking respect the requested metric, and updated other call sites to pass explicitdistwhere test determinism required it.dist = NULLmapping to the native"nns"alias and updated Python documentation to explaindist=Nonesemantics.tests/invariants/test_native_distance_defaults.py) and updated parity tests to include explicitdist="L2"in parity scenarios where deterministic L2 behavior was intended.Testing
tests/invariants/test_native_distance_defaults.py, which validatesdist=Noneequivalence withdist="NNS", the native distance formula, and propagation throughnns_stack/nns_boost; the test passed.nns_reg,nns_m_reg,nns_stack, andnns_boostwith explicitdist="L2"where required; parity tests passed.Codex Task