Skip to content

Config: add four KNN tuning fields to NumericImputationConfig #150

@DEVunderdog

Description

@DEVunderdog

Parent

#90

What to build

Add four new configurable fields to NumericImputationConfig (in src/dataforge_ml/imputation/_config.py) that bound and gate the adaptive KNN parameter selection introduced in Scope 1:

  • knn_min_neighbors: int = 5 — floor on computed k
  • knn_max_neighbors: int = 25 — cap on computed k
  • knn_distance_weight_max_null_ratio: float = 0.15 — miss_frac threshold above which distance weighting is disabled
  • knn_distance_weight_max_features: int = 30 — dimensionality threshold above which distance weighting is disabled

Wire all four into to_dict / from_dict. Add unit tests in test_imputation_config.py covering default values and round-trip serialisation.

Acceptance criteria

  • NumericImputationConfig declares all four fields with the specified defaults
  • to_dict() includes all four fields
  • from_dict() restores all four fields correctly (round-trip test)
  • Unit tests in test_imputation_config.py assert defaults and round-trip
  • Numpy-style docstring added/updated on NumericImputationConfig per ADR-0034

Blocked by

None — can start immediately

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions