imputegap.algorithms.zero_impute package

The imputegap.algorithms.zero_impute package contains various imputation algorithms used for handling missing values in time series data. This package supports multiple imputation techniques like CDRec, MRNN, IIM, and more.

Submodules

Modules

imputegap.algorithms.zero_impute.zero_impute(incomp_data, params=None)[source]

Impute missing values (NaNs) with zeros in the time series.

Parameters

incomp_datanumpy.ndarray

The input time series matrix with missing values represented as NaNs.

paramsdict, optional

Optional parameters for the algorithm. This is not used in the current implementation but can be passed for future extensions (default is None).

Returns

numpy.ndarray

The imputed matrix where all NaN values have been replaced by zeros.

Notes

This simple imputation strategy replaces all missing values (NaNs) with zeros. This can be useful for initializing datasets where more complex imputation methods will follow.

Example

>>> incomp_data = np.array([[1, 2, np.nan], [4, np.nan, 6]])
>>> recov_data = zero_impute(incomp_data)
>>> print(recov_data)
array([[1., 2., 0.],
       [4., 0., 6.]])
author:

Quentin Nater