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