Skip to content

Implement missing value imputation utilities in trueml.preprocessing.impute #35

Description

@iamprasadraju

Description

Introduce an impute module to trueml.preprocessing for handling missing values. The module should provide a simple, extensible API for imputing missing data while following the same fit/transform interface used throughout the preprocessing package.

The implementation should begin with SimpleImputer, with more advanced imputers added in future iterations.

Tasks

  • Create the trueml.preprocessing.impute package.
  • Implement SimpleImputer.
  • Support the following strategies:
    • "mean"
    • "median"
    • "most_frequent"
    • "constant"
  • Implement fit(), transform(), and fit_transform().
  • Store learned statistics in a statistics_ attribute.
  • Support both 1D and 2D NumPy arrays.
  • Preserve input shape after transformation.
  • Validate inputs and raise informative errors.
  • Export SimpleImputer from trueml.preprocessing.
  • Add comprehensive docstrings and usage examples.
  • Add unit tests covering all supported strategies and edge cases.

Future Work

  • Implement MissingIndicator.
  • Implement KNNImputer.
  • Implement IterativeImputer.
  • Support custom imputation strategies.
  • Explore optional integration with Pandas DataFrames while keeping NumPy as the primary dependency.

Scope

This issue focuses on establishing the missing value imputation API and implementing SimpleImputer. More advanced imputation techniques will be tracked in separate issues as the preprocessing module evolves.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status
Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions