/TSF-library

scikit-learn extension for forecasting through time series preprocessing models

Primary LanguagePython

Travis AppTrevor Codecov Python27 Python35

TSF library

TSF is a library that extend Scikit-learn software composed by several time series preprocessing algorithms developed at the University of Cordoba in the Learning and Artificial Neural Networks (AYRNA) research group. This library is able to preprocess any time serie, either univariate or multivariate, and create a inputs matrix for every sample of the time serie(s) so any model of Scikit-learn can be trained.

Times series data is preprocessed using windows-based models such as Autorregresive Model, which takes n_prev samples for every sample of the time serie. TSF comes with 3 different windows-based autorregressive models:

  • SimpleAR
  • DinamicWindow
  • ClassChange [1]

Further information about these models can be found on online documentation.

Installation

Dependencies

TSF use requires:

  • Python (>= 2.7 or >= 3.4)
  • NumPy (>= 1.8.2)
  • SciPy (>= 0.13.3)
  • Scikit-learn (>= 0.19)

User installation

The easiest way to install TSF and all the dependencies is using pip:

pip install tsf
You can also clone the repository and install the library manually:
cd TSF-library
python setup.py install

Tests

TSF code can be test using pytest on root directory. Once installed, please run the following command to check the library was successfully installed:

pytest tests/

Note

Warnings should appear as tests change dynamically forecasting time horizon.

Documentation

Examples of use and installation guide can be found in the online documentation hosted by ReadTheDocs.

References

  • [1] P.A. Gutierrez, J. C. Fernández, M. Pérez-Ortiz, L. Cornejo-Bueno, E. Alexandre-Cortizo and C. Herv́as-Mart́ınez, "Energy flux range classification by using a dynamic window autoregressive model," Lecture Notes in Computer Science, pp. 92–102.