Skip to content

Fix NumericImputationConfig block-model overrides: knn_n_neighbors and mice_max_iter #219

Description

@DEVunderdog

Parent

#92

What to build

Correct the config surface for KNN and MICE block-model overrides. Both strategies fit one shared model for the entire block — per-column dict overrides are semantically wrong. See ADR-0037.

Remove per_column_n_neighbors: dict[str, int]. Add knn_n_neighbors: Optional[int] — scalar, KNN block only. All KNN columns share one KNNImputer; a single value governs the entire block.

Add mice_max_iter: Optional[int] — scalar, MICE block only. All MICE columns share one IterativeImputer; a single value governs the entire block.

Retain per_column_max_iter: dict[str, int] for Regression only — each Regression column gets its own IterativeImputer, so per-column values are semantically valid. Update its docstring to say Regression only (remove the MICE mention).

Acceptance criteria

  • per_column_n_neighbors field removed from NumericImputationConfig
  • knn_n_neighbors: Optional[int] = None added to NumericImputationConfig
  • mice_max_iter: Optional[int] = None added to NumericImputationConfig
  • per_column_max_iter docstring updated to say Regression columns only
  • knn_n_neighbors and mice_max_iter appear in to_dict() output
  • from_dict() round-trips both fields correctly; from_dict({}) produces None defaults
  • test_imputation_config.py: existing per_column_n_neighbors tests replaced with knn_n_neighbors equivalents; mice_max_iter default, to_dict, and round-trip tests added
  • Numpy-style docstring on NumericImputationConfig updated for all three changed fields (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