-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
releasedIncluded in a releaseIncluded in a release
Description
Is your feature request related to a problem?
We currently only have a basic imputer, but there are more sophisticated imputation strategies.
Desired solution
Add a KNearestNeighborsImputer that uses the KNNImputer of scikit-learn internally.
- Superclass:
TableTransformer - Constructor parameters:
neighbor_count: int,column_names: str | list[str] | None = None(keyword-only). List of columns to transform, if None all columns passed infit.value_to_replace: float | str | None = None(keyword-only)
- Attributes:
self._wrapped_transformer: sk_KNNImputer | None = None
fit:- Call
_check_columns_existto ensure columns to transform exist - Raise value error if
row_countis 0 - Create a new instance of the
KNearestNeighborsImputer, don't mutate it in place - Create and fit an
sk_KNNImputerand store it in_wrapped_transformerof the copied transformer
- Call
transform:-
TransformerNotFittedErrorif transformer is not fitted -
Call
_check_columns_existto ensure columns to transform exist -
Transform with the
_wrapped_transformer
-
Possible alternatives (optional)
No response
Screenshots (optional)
No response
Additional Context (optional)
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
releasedIncluded in a releaseIncluded in a release
Type
Projects
Status
✔️ Done