tempor.methods.preprocessing.imputation.temporal.plugin_ffill module¶
Implementation using ffill.
- class tempor.methods.preprocessing.imputation.temporal.plugin_ffill.FFillImputer(**params: Any)[source]¶
Bases:
BaseImputerForward-first Time-Series Imputation.
- Parameters:¶
- **params : Any
Additional parameters.
Note
The data will be represented as a multi-index
(sample_idx, time_idx)dataframe of features. Thenffill,bfillandfillna(0.0)`will be called in that order.Example
>>> from tempor import plugin_loader >>> >>> dataset = plugin_loader.get( ... "prediction.one_off.sine", ... plugin_type="datasource", ... with_missing=True, ... ).load() >>> assert dataset.time_series.dataframe().isna().sum().sum() != 0 >>> >>> # Load the model: >>> model = plugin_loader.get("preprocessing.imputation.temporal.ffill") >>> >>> # Train: >>> model.fit(dataset) FFillImputer(...) >>> >>> # Impute: >>> imputed = model.transform(dataset) >>> assert imputed.time_series.dataframe().isna().sum().sum() == 0- static hyperparameter_space(*args: Any, **kwargs: Any) list[Params][source]¶
The hyperparameter search domain, used for tuning.
Can provide variadics
*argsand**kwargs, these will be received fromsample_hyperparameters.
-
category : ClassVar[plugin_typing.PluginCategory] =
'preprocessing.imputation.temporal'¶ Plugin category, such as
'prediction.one_off.classification'. Must be set by the plugin class using@register_plugin.
-
name : ClassVar[plugin_typing.PluginName] =
'ffill'¶ Plugin name, such as
'my_nn_classifier'. Must be set by the plugin class using@register_plugin.
-
plugin_type : ClassVar[plugin_typing.PluginTypeArg] =
'method'¶ Plugin type, such as
'method'. May be optionally set by the plugin class using@register_plugin, else will set the default plugin type.