imputegap.algorithms.stmvl package¶
The imputegap.algorithms.stmvl 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.stmvl.native_stmvl(__py_matrix, __py_window, __py_gamma, __py_alpha)[source]¶
Perform matrix imputation using the STMVL algorithm with native C++ support.
Parameters¶
- __py_matrixnumpy.ndarray
The input matrix with missing values (NaNs).
- __py_windowint
The window size for the temporal component in the STMVL algorithm.
- __py_gammafloat
The smoothing parameter for temporal weight (0 < gamma < 1).
- __py_alphafloat
The power for the spatial weight.
Returns¶
- numpy.ndarray
The recovered matrix after imputation.
Notes¶
The STMVL algorithm leverages temporal and spatial relationships to recover missing values in a matrix. The native C++ implementation is invoked for better performance.
Example¶
>>> recov_data = stmvl(incomp_data=incomp_data, window_size=2, gamma=0.85, alpha=7) >>> print(recov_data)
References¶
Yi, X., Zheng, Y., Zhang, J., & Li, T. ST-MVL: Filling Missing Values in Geo-Sensory Time Series Data. School of Information Science and Technology, Southwest Jiaotong University; Microsoft Research; Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences.
- imputegap.algorithms.stmvl.stmvl(incomp_data, window_size, gamma, alpha, logs=True)[source]¶
CDREC algorithm for imputation of missing data :author: Quentin Nater
- Parameters:
incomp_data – time series with contamination
window_size – window size for temporal component
gamma – smoothing parameter for temporal weight
alpha – power for spatial weight
logs – print logs of time execution
- Returns:
recov_data, metrics : all time series with imputation data and their metrics