Made by Xinyu Chen • 🌐 https://twitter.com/chenxy346
Python codes for tensor factorization, tensor completion, and tensor regression techniques with the following real-world applications:
- geotensor | Image inpainting
- transdim | Spatiotemporal traffic data imputation and prediction
- Recommender systems
- mats | Multivariate time series imputation and forecasting
In a hurry? Please check out our contents as follows.
We conduct extensive experiments on some real-world data sets:
-
Large-scale PeMS traffic speed data set registers traffic speed time series from 11160 sensors over 4/8/12 weeks (for PeMS-4W/PeMS-8W/PeMS-12W) with 288 time points per day (i.e., 5-min frequency) in California, USA. You can download this data set and place it at the folder of
datasets
.- Data path example:
../datasets/California-data-set/pems-4w.csv
.
- Data path example:
mats is a project in the tensor learning repository, and it aims to develop machine learning for multivariate time series forecasting.
Low-Rank Autoregressive Tensor Completion for Multivariate Time Series Forecasting.
[arXiv]
Figure 1: Illustration of our proposed Low-Rank Tensor Completion (LATC) imputer/predictor with a prediction window τ (green nodes: observed values; white nodes: missing values; red nodes/panel: prediction; blue panel: training data to construct the tensor).
In this work, we develop a Low-Rank Autoregressive Tensor Completion for multivariate time series forecasting in the presence of missing values. To overcome the challenge of missing time series values, our LATC model takes into account:
- autoregressive process on the matrix structure to capture local temporal states,
- and low-rank assumption on the tensor structure to capture global low-rank patterns simultaneously.
Python codes for reproducing experiments are provided in the ../mats folder. Since these Python codes were written on the Jupyter Notebook, you could also view them on the nbviewer. Please open
If you find these codes useful, please star (★) this repository.
We summarize some preliminaries for better understanding tensor learning. They are given in the form of tutorial as follows.
-
Foundations of Python Numpy Programming
- Generating random numbers in Matlab and Numpy [Jupyter notebook] [blog post]
-
Foundations of Tensor Computations
- Kronecker product
-
Singular Value Decomposition (SVD)
- Randomized singular value decomposition [Jupyter notebook] [blog post]
- Tensor singular value decomposition
- Ruye Wang (2010). Introduction to Orthogonal Transforms with Applications in Data Processing and Analysis. Cambridge University Press. [PDF]
- If you want to run the code, please
- download (or clone) this repository,
- open the
.ipynb
file using Jupyter notebook, - and run the code.
This repository is from the following paper, please cite our paper if it helps your research.
- Xinyu Chen, Lijun Sun (2020). Low-rank autoregressive tensor completion for multivariate time series forecasting. arXiv: 2006.10436. [preprint] [data & Python code]
This research is supported by the Institute for Data Valorization (IVADO).
This work is released under the MIT license.