MODULE REFERENCE

missing_values_filler

anomx.data.processing.transformers.missing_values_filler

Missing 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

Signature parameters
ParameterTypeDefault
fillstr | float'auto'
namestr'MissingValuesFiller'
n_jobsint1
verboseboolFalse
columnsstr | list[str] | NoneNone

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.interpolate method.

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 different TimeSeries. Defaults to 1 (sequential). Setting the parameter to -1 means 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 BaseDataTransformer documentation. 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
Signature parameters
ParameterTypeDefault
seriesTimeSeriesrequired
paramsMapping[str, Any]required
**kwargs——

Returns TimeSeries