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, __verbose=True)[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.
- __verbosebool, optional
Whether to display the contamination information (default is False).
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, verbose=True)[source]¶
ST-MVL algorithm for imputation of missing data
Parameters¶
- incomp_datanumpy.ndarray
The input matrix with contamination (missing values represented as NaNs).
- window_sizeint
window size for temporal component
- gammafloat
smoothing parameter for temporal weight
- alphafloat
power for spatial weight
- logsbool, optional
Whether to log the execution time (default is True).
- verbosebool, optional
Whether to display the contamination information (default is False).
- lib_pathstr, optional
Custom path to the shared library file (default is None).
- verbosebool, optional
Whether to display the contamination information (default is True).
Returns¶
- numpy.ndarray
The imputed matrix with missing values recovered.
Example¶
>>> recov_data = stmvl(incomp_data=incomp_data, window_size=7, gamma=0.85, alpha=7, logs=True) >>> 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.