fix(estimator): pass distance metric parameters as metric_params to NearestNeighbors#1563
fix(estimator): pass distance metric parameters as metric_params to NearestNeighbors#1563TasfinMahmud wants to merge 2 commits into
Conversation
…earestNeighbors Fixes issue py-why#1390. NearestNeighbors expects metric parameters (like the V matrix for Mahalanobis distance) to be passed through the metric_params argument, rather than as top-level kwargs. Signed-off-by: Tasfin Mahmud <tasfinmahmud1@gmail.com>
|
🤖 This is an automated response from Repo Assist. Thanks for contributing this fix, Context for maintainers: Repo Assist previously submitted PRs #1475, #1508, and #1526 for this same issue (#1390). All three have now accumulated merge conflicts since PR #1465 (which refactored One minor note: PR #1526's fix included The fix and test look good. Once CI runs and passes, this should be merge-ready.
|
Signed-off-by: Amit Sharma <amit_sharma@live.com>
Fixes #1390.
NearestNeighbors expects metric parameters (like the V matrix for Mahalanobis distance) to be passed through the
metric_paramsargument, rather than as top-level kwargs.This PR passes
self.distance_metric_paramsusing themetric_paramsargument inDistanceMatchingEstimator. A regression test is included to ensuremethod_params={"V": ...}behaves correctly end-to-end without failing.