hyperimpute.plugins.imputers.plugin_median module
- class MedianPlugin(random_state: int = 0)
Bases:
ImputerPlugin
Imputation plugin for completing missing values using the Median Imputation strategy.
- Method:
The Median Imputation strategy replaces the missing values using the median along each column.
Example
>>> import numpy as np >>> from hyperimpute.plugins.imputers import Imputers >>> plugin = Imputers().get("median") >>> plugin.fit_transform([[1, 1, 1, 1], [np.nan, np.nan, np.nan, np.nan], [1, 2, 2, 1], [2, 2, 2, 2]]) 0 1 2 3 0 1.0 1.0 1.0 1.0 1 1.0 2.0 2.0 1.0 2 1.0 2.0 2.0 1.0 3 2.0 2.0 2.0 2.0
- _abc_impl = <_abc_data object>
- _fit(X: DataFrame, *args: Any, **kwargs: Any) MedianPlugin
- _transform(X: DataFrame) DataFrame
- module_relative_path: Optional[Path]
- static name() str
- plugin
alias of
MedianPlugin