MODULE REFERENCE
missing_values_filler
anomx.data.processing.transformers.missing_values_fillerMissing Values Filler
MissingValuesFiller
MissingValuesFiller(fill: str | float = 'auto', name: str = 'MissingValuesFiller', n_jobs: int = 1, verbose: bool = False, columns: str | list[str] | None = None)Bases: BaseDataTransformer
| Parameter | Type | Default |
|---|---|---|
fill | str | float | 'auto' |
name | str | 'MissingValuesFiller' |
n_jobs | int | 1 |
verbose | bool | False |
columns | str | list[str] | None | None |
Data transformer to fill missing values from a (sequence of) deterministic TimeSeries.
Parameters
- fill
The value used to replace the missing values. If set to 'auto', will auto-fill missing values using the
pandas.DataFrame.interpolatemethod.- name
A specific name for the transformer
- n_jobs
The number of jobs to run in parallel. Parallel jobs are created only when a
Sequence[TimeSeries]is passed as input to a method, parallelising operations regarding differentTimeSeries. Defaults to1(sequential). Setting the parameter to-1means using all the available processors. Note: for a small amount of data, the parallelisation overhead could end up increasing the total required amount of time.- verbose
Optionally, whether to print operations progress
- columns
Optionally, a string or list of strings specifying the names of the components (columns) to transform. If specified, only these components will be transformed, and the remaining components will be kept untouched. For more information refer to the
BaseDataTransformerdocumentation. In case the transformer is applied on multiple TimeSeries, it is expected that all series have the same column order.
Examples
>>> import numpy as np
>>> from anomx.data.timeseries import TimeSeries
>>> from anomx.data.processing.transformers import MissingValuesFiller
>>> values = np.arange(start=0, stop=1, step=0.25)
>>> values[1:3] = np.nan
>>> series = TimeSeries.from_values(values)
>>> transformer = MissingValuesFiller()
>>> series_filled = transformer.transform(series)
>>> print(series_filled.values())
[[0. ]
[0.25]
[0.5 ]
[0.75]]Members
ts_transformstaticmethod
ts_transform(series: TimeSeries, params: Mapping[str, Any], **kwargs) -> TimeSeries| Parameter | Type | Default |
|---|---|---|
series | TimeSeries | required |
params | Mapping[str, Any] | required |
**kwargs | — | — |
Returns TimeSeries