├── .github └── workflows │ └── run_tests.yml ├── .gitignore ├── .vscode └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── badges └── coverage.svg ├── create_docs.sh ├── docs ├── index.html └── timexseries │ ├── data_ingestion.html │ ├── data_prediction │ ├── index.html │ ├── models │ │ ├── arima_predictor.html │ │ ├── exponentialsmoothing_predictor.html │ │ ├── index.html │ │ ├── lstm_predictor.html │ │ ├── mockup_predictor.html │ │ ├── neuralprophet_predictor.html │ │ ├── predictor.html │ │ └── prophet_predictor.html │ ├── pipeline.html │ ├── transformation.html │ ├── validation_performances.html │ └── xcorr.html │ ├── data_visualization │ ├── functions.html │ └── index.html │ ├── images │ ├── Architecture.drawio │ └── Architecture.svg │ ├── index.html │ └── timeseries_container.html ├── examples ├── BitcoinPriceForecasting.ipynb ├── Covid-19SwitzerlandTicinoForecasting.ipynb ├── DailyMinTemperaturesForecasting.ipynb ├── datasets │ ├── BitcoinPrice.csv │ └── TicinoCovid-19.csv ├── figures │ ├── BitcoinPrice │ │ ├── Bitcoin_Data_Overview.png │ │ ├── Bitcoin_Historical_Plot.png │ │ ├── Bitcoin_Historical_Plot_Detail.png │ │ └── Bitcoin_Performance_Plot.png │ └── SwissCovid │ │ ├── Covid-19Ticino_data_overview.png │ │ ├── HistoricalPlotSwissCovid.png │ │ ├── TrainingWindows.drawio │ │ └── TrainingWindows.png └── historical_predictions │ ├── historical_predictions_bitcoin.pkl │ └── historical_predictions_swiss_covid_fbprophet.pkl ├── experiments ├── FreqEstimator │ ├── AEP.csv │ ├── AirlinePassengers.csv │ ├── BrentOil.csv │ ├── Covid.csv │ ├── FrequencyEstimator.ipynb │ ├── Steel.csv │ └── Test7.csv └── SingularMatrixError │ └── BitcoinPriceForecasting.ipynb ├── poetry.lock ├── pyproject.toml ├── tests ├── __init__.py ├── context.py ├── launch_tests.sh ├── test_data_ingestion.py ├── test_data_prediction.py ├── test_data_visualization.py ├── test_datasets │ ├── covid_example_data_ingestion.csv │ ├── data_visualization │ │ ├── create_demo.py │ │ ├── expected_children1.pkl │ │ └── test1.csv │ ├── infer_freq_datasets │ │ ├── _BrentOil.csv │ │ ├── _Copper.csv │ │ ├── _Gold.csv │ │ ├── _Steel.csv │ │ ├── _StockExample.csv │ │ ├── _Bitcoin.csv │ │ ├── _Covid.csv │ │ ├── _AEP.csv │ │ ├── _APU.csv │ │ ├── _AirlinePassengers.csv │ │ └── _StockExample.csv │ ├── test_1.csv │ ├── test_1_1.csv │ ├── test_1_2.csv │ ├── test_2.csv │ ├── test_3.csv │ ├── test_4.csv │ ├── test_5.csv │ ├── test_5_1.csv │ ├── test_6.csv │ ├── test_6_expected.csv │ ├── test_7.csv │ ├── test_covid.csv │ ├── test_create_containers_extrareg_d.csv │ ├── test_create_containers_extrareg_e.csv │ └── test_data_reordering.csv └── utilities.py └── timexseries ├── __init__.py ├── data_ingestion.py ├── data_prediction ├── __init__.py ├── models │ ├── __init__.py │ ├── arima.py │ ├── exponential_smoothing.py │ ├── flaml.py │ ├── linear.py │ ├── lstm.py │ ├── mockup.py │ ├── neuralprophet.py │ ├── persistence.py │ ├── predictor.py │ ├── prophet.py │ ├── random_walk_with_drift.py │ ├── seasonal_persistence.py │ └── seasonality_estimator.py ├── pipeline.py ├── transformation.py └── xcorr.py ├── data_visualization ├── __init__.py ├── functions.py └── locales │ ├── base.pot │ ├── en │ └── LC_MESSAGES │ │ ├── messages.mo │ │ └── messages.po │ └── it │ └── LC_MESSAGES │ ├── messages.mo │ └── messages.po └── documentation.md /.github/workflows/run_tests.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | 7 | jobs: 8 | build: 9 | strategy: 10 | fail-fast: false 11 | matrix: 12 | python-version: ['3.9', '3.10', '3.11'] 13 | poetry-version: ['1.2.2'] 14 | os: [ubuntu-latest] 15 | 16 | runs-on: ${{ matrix.os }} 17 | 18 | steps: 19 | - uses: actions/checkout@v2 20 | - name: Set up Python ${{ matrix.python-version }} 21 | uses: actions/setup-python@v2 22 | with: 23 | python-version: ${{ matrix.python-version }} 24 | 25 | - name: Install poetry ${{ matrix.poetry-version }} 26 | run: | 27 | python -m ensurepip 28 | python -m pip install --upgrade pip 29 | python -m pip install poetry==${{ matrix.poetry-version }} 30 | 31 | - name: Install dependencies 32 | shell: bash 33 | run: python -m poetry install --with data_prediction,data_visualization 34 | 35 | - name: Test with pytest 36 | run: | 37 | cd tests 38 | python -m poetry run python -m pytest -v 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | #*.mo 56 | #*.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | /.idea/ 131 | /result_directory/ 132 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.testing.unittestEnabled": false, 3 | "python.testing.pytestEnabled": true 4 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [1.2.2] - 2022-02-09 4 | - Bump dependencies 5 | - Managed different import mechanisms for Dash 6 | 7 | ## [1.2.1] - 2021-06-23 8 | - Removed automatic Seasonal part of ARIMA; it could take a long time. Further investigation on `pmdarima` is requested; 9 | - Fixed a bug in which CSV with dates in the format `1959-01` were not correctly recognized; 10 | - Fixed a bug in Yeo-Johnson transformation which would "lose" the datetime index of transformed data; 11 | - Bump dependencies. 12 | 13 | ## [1.2.0] - 2021-04-08 14 | 15 | ### Added 16 | - Exponential Smoothing model, with automatic selection of seasonality and inner model 17 | - Options to set max and min values for predictions (if upper/lowerbounds are known beforehand) 18 | - Option to round the predictions to the nearest integer 19 | - Added `_all` key to set additional regressors for all the time-series in a dataset 20 | 21 | ### Changed 22 | - Multithreading now uses Joblib: it should work on all platforms, and also for NeuralProphet/LSTM models 23 | - Fix bug: cross-correlation were wrong if max_lags was higher than the length of the dataset 24 | - Models can be specified in the `param_config` dictionary using lowercase names 25 | - Bump dependencies 26 | 27 | ## [1.1.0] - 2021-03-08 28 | 29 | ### Added 30 | 31 | - Resizable histograms in data visualization 32 | - Historical error plot and histogram with percentual 33 | - Buttons to quickly change box and aggregate box plots period 34 | - Added standard deviation of error in error metrics 35 | - New options for `model_parameters`: `min_values`/`max_values` which can be used to specify minimum and maximum 36 | values to use in prediction 37 | - New option for `model_parameters`: `round_to_integer` useful to point columns'names which should be predicted 38 | as integer numbers 39 | 40 | ### Changed 41 | 42 | - When using `max_threads: 1` multiprocessing is completely ignored, this temporarily fix some issues on MacOs. 43 | Multiprocessing should be rewritten to work on all platforms. 44 | 45 | ## [1.0.0] - 2021-02-17 46 | 47 | Initial release. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TIMEX 2 | [![Tests with PyTest](https://github.com/AlexMV12/TIMEX/actions/workflows/run_tests.yml/badge.svg)](https://github.com/AlexMV12/TIMEX/actions/workflows/run_tests.yml) 3 | ![Coverage](badges/coverage.svg) 4 | ![PyPI](https://img.shields.io/pypi/v/timexseries) 5 | ![PyPI - Downloads](https://img.shields.io/pypi/dm/timexseries) 6 | 7 | TIMEX (referred in code as `timexseries`) is a framework for time-series-forecasting-as-a-service. 8 | 9 | Its main goal is to provide a simple and generic tool to build websites and, more in general, 10 | platforms, able to provide the forecasting of time-series in the "as-a-service" manner. 11 | 12 | This means that users should interact with the service as less as possible. 13 | 14 | An example of the capabilities of TIMEX can be found at [covid-timex.it](https://covid-timex.it) 15 | That website is built using the [Dash](https://dash.plotly.com/), on which the visualization 16 | part of TIMEX is built. A deep explanation is available in the 17 | [dedicated repository](https://github.com/AlexMV12/covid-timex.it). 18 | 19 | ## Installation 20 | The main two dependencies of TIMEX are [Facebook Prophet](https://github.com/facebook/prophet) 21 | and [PyTorch](https://pytorch.org/). 22 | If you prefer, you can install them beforehand, maybe because you want to choose the CUDA/CPU 23 | version of Torch. 24 | 25 | However, installation is as simple as running: 26 | 27 | `pip install timexseries` 28 | 29 | ## Get started 30 | Please, refer to the Examples folder. You will find some Jupyter Notebook which illustrate 31 | the main characteristics of TIMEX. A Notebook explaining the covid-timex.it website is present, 32 | along with the source code of the site, [here](https://github.com/AlexMV12/covid-timex.it). 33 | 34 | ## Documentation 35 | The full documentation is available at [here](https://alexmv12.github.io/TIMEX/timexseries/index.html). 36 | 37 | ## Contacts 38 | If you have questions, suggestions or problems, feel free to open an Issue. 39 | You can contact us at: 40 | 41 | - alessandro.falcetta@polimi.it 42 | - manuel.roveri@polimi.it 43 | 44 | -------------------------------------------------------------------------------- /badges/coverage.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | coverage 17 | coverage 18 | 27% 19 | 27% 20 | 21 | 22 | -------------------------------------------------------------------------------- /create_docs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | pdoc --config latex_math=True --force --html --output-dir docs timexseries -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/timexseries/data_prediction/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | timexseries.data_prediction API documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |

Module timexseries.data_prediction

24 |
25 |
26 |
27 | 28 | Expand source code 29 | 30 |
from timexseries.data_prediction.models.predictor import PredictionModel
31 | from .validation_performances import ValidationPerformance
32 | from .pipeline import create_timeseries_containers
33 |
34 |
35 |
36 |

Sub-modules

37 |
38 |
timexseries.data_prediction.models
39 |
40 |
41 |
42 |
timexseries.data_prediction.pipeline
43 |
44 |
45 |
46 |
timexseries.data_prediction.transformation
47 |
48 |
49 |
50 |
timexseries.data_prediction.validation_performances
51 |
52 |
53 |
54 |
timexseries.data_prediction.xcorr
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | 89 |
90 | 93 | 94 | -------------------------------------------------------------------------------- /docs/timexseries/data_prediction/models/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | timexseries.data_prediction.models API documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |

Module timexseries.data_prediction.models

24 |
25 |
26 |
27 |
28 |

Sub-modules

29 |
30 |
timexseries.data_prediction.models.arima_predictor
31 |
32 |
33 |
34 |
timexseries.data_prediction.models.darts
35 |
36 |
37 |
38 |
timexseries.data_prediction.models.exponentialsmoothing_predictor
39 |
40 |
41 |
42 |
timexseries.data_prediction.models.lstm_predictor
43 |
44 |
45 |
46 |
timexseries.data_prediction.models.mockup_predictor
47 |
48 |
49 |
50 |
timexseries.data_prediction.models.neuralprophet_predictor
51 |
52 |
53 |
54 |
timexseries.data_prediction.models.predictor
55 |
56 |
57 |
58 |
timexseries.data_prediction.models.prophet_predictor
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | 96 |
97 | 100 | 101 | -------------------------------------------------------------------------------- /docs/timexseries/data_visualization/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | timexseries.data_visualization API documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |

Module timexseries.data_visualization

24 |
25 |
26 |
27 | 28 | Expand source code 29 | 30 |
from .functions import create_timeseries_dash_children
31 |
32 |
33 |
34 |

Sub-modules

35 |
36 |
timexseries.data_visualization.functions
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | 67 |
68 | 71 | 72 | -------------------------------------------------------------------------------- /docs/timexseries/images/Architecture.drawio: -------------------------------------------------------------------------------- 1 | 7Vpbc+I2FP41zLQPy9iSzeUxIUkvk20zk7QhTzvCFkZb22JkEWB//UpY8kUyxSEGdprCA9LRBfk73zk6OlYPTpLNLwwtF59piOMecMJND970AHDBCIofKdnmkqHv5YKIkVB1KgWP5BtWQkdJVyTEWa0jpzTmZFkXBjRNccBrMsQYXde7zWlc/9clirAleAxQbEufScgXSuoOxmXDr5hEC/XXIzDMGxKkO6snyRYopOuKCN724IRRyvNSspngWIKnccnH3e1pLRbGcMrbDPgDp7/7X7zo+enhZvpXOAHPo8knNcsrilfqgZ9Igj9lmBGBulAb4kj8/DR5/Ptn9Rh8q7FhdJWGWE7v9OD1ekE4flyiQLauBRuEbMGTWNRcUZyTOJ7QmLLdWDgfBTgIhDzjjP6DKy2zke/5ckK1NMw43ux9ZrdAUlAQ0wRzthVd1AA49vMhW603pYx1qcuxEi0qWvSUDCn2RMXMJcCioDB+A97AwrsHBiiRWKWzTP48/fb5dvo+qCVkRFD4KiZRKmScyg5I1WI854Y+UpqKma5DlC12/+F2g34Bo0Z/bKPvOU3wj0+Fv9+AvwF1gYJEmq54TFJBT+1dnDrUGtRAQIIFlNcxmuH4gWaEE1pr0Eq5NzrMKOc02as14TWWcmHJJpIOtr/Gs5hGNOt/zWj6BTQrsgPdubCuOwhs3Y2cvmcrD/h94FQ/8ES6HFi6FGqak2jF0A5bMIgl0WdMlCJZokspzyyNC5R4Xa11p6RQbQDaUr+pxISEofybRpOtG/UplOY3Ke2M7m5oqegm31BIGuEs11JXm0p33IejOowA2jC6oAHHwalwHB12WzgNr2S8I9kYoywjQR0q8exsO1Ww7iovstL3dfVmU2282erahvCpnkOUXyrycois6BH50nBoBVYG/mL5dMUCfNjEOWIR5od4Zuuzoi+/QV1axnAsPMZrfblNOlT/8ECJeJDS6nzD6hyDBvljqlHVCM2YCDgG73xjohwHayKhd7StdFvKDtn+BRc83dbrJUPzGUu+FpgeT+FxBxRWVFSkVWR0/5WMJe1Lpr9U2/bQvkMS62PLD01iYPg8d3gkiaGxBxWO8gCJu+KZjvA/INGGLYnm7tn+zsM0z60TxDO9XFumeYYb80y/e2qmQZtYQo2PqkoZX4hIPUXxbSk1Yr6yzz2V4f6OY18x51uVCUErTvft45dzaG09mguaidaaQe8Kmty2yY0HlIpDnyjJ4PSOoQR3nOvw5bcp1zHYfeQImvKKPP90FM0OYX9YT4M0HeZcCPq+bfQnOxq4/ke1HtDWeryLWo+dqrrDiK8YlmtnKM3mlCXqpO0IC+rJ7CrDARLnujQStUQmg6VZBQyrfpN8LEl3PSbWwO7M7nSnQdiQxWo8DY5OZjrDj2o6XlvTGVzSdIqM///62ddxfFHX5h0IDFQO3tEpRKIziIHYpoX3wizTTWIBRet/O2jwncsHDcC7hGV1aSFtM1oAvtNCjsoMQVjX+VBFaSfNDLl2Ir/I3WvT+nOXukdi3quK5c1Ky6u/RFOR/SvJVigm33SUsiaCuAINoWEZuQRShGeZMMtalPLjxSDAtMW2McjJMtKunc+r+1Ad0smyfH2ch3vT+8dpXur3+92eskKER/PGN8qDYIRn82404Rs52mHjUeqsPtE+5tpOsmXCq32S/9jXCR360raudF8W4kxvB4x0l39suss10l1+y3TXm98OGOcdD57h7YDm7CXecLWn5NHnjjPl8A2qwaOpZlDAb5nDfzPVjAUPwDmoBi2qPRdBgIoQeG0ry7jQSibihcy+U9CU+GA4W8XcvmewgwOz21csUVE3DfStMKdXuYBj3DI5eB2hJ3Utv73ub6A0XoGxLj6Y91TofE4C3BcHpgAvedbXcVY39xwMVzhoCIf8ccMePH7zHiyq5RW9nILlRUd4+x0= -------------------------------------------------------------------------------- /examples/figures/BitcoinPrice/Bitcoin_Data_Overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DhiriaDev/TIMEX/767841a830bdc6fafbe1702700b9f80175e357de/examples/figures/BitcoinPrice/Bitcoin_Data_Overview.png -------------------------------------------------------------------------------- /examples/figures/BitcoinPrice/Bitcoin_Historical_Plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DhiriaDev/TIMEX/767841a830bdc6fafbe1702700b9f80175e357de/examples/figures/BitcoinPrice/Bitcoin_Historical_Plot.png -------------------------------------------------------------------------------- /examples/figures/BitcoinPrice/Bitcoin_Historical_Plot_Detail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DhiriaDev/TIMEX/767841a830bdc6fafbe1702700b9f80175e357de/examples/figures/BitcoinPrice/Bitcoin_Historical_Plot_Detail.png -------------------------------------------------------------------------------- /examples/figures/BitcoinPrice/Bitcoin_Performance_Plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DhiriaDev/TIMEX/767841a830bdc6fafbe1702700b9f80175e357de/examples/figures/BitcoinPrice/Bitcoin_Performance_Plot.png -------------------------------------------------------------------------------- /examples/figures/SwissCovid/Covid-19Ticino_data_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DhiriaDev/TIMEX/767841a830bdc6fafbe1702700b9f80175e357de/examples/figures/SwissCovid/Covid-19Ticino_data_overview.png -------------------------------------------------------------------------------- /examples/figures/SwissCovid/HistoricalPlotSwissCovid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DhiriaDev/TIMEX/767841a830bdc6fafbe1702700b9f80175e357de/examples/figures/SwissCovid/HistoricalPlotSwissCovid.png -------------------------------------------------------------------------------- /examples/figures/SwissCovid/TrainingWindows.drawio: -------------------------------------------------------------------------------- 1 | 5Vtbc6M2FP41ntk+2AOI62PsJLsz3baZSbrtPhIjY7YYeQRe2/n1lYy4SeJiB7DT+iFBQsjwne9850gcT8Bic/iM3e36N+TBcKIp3mEC7ieapiqmRv7RnmPaY2p62uHjwGODio7n4A1mV7LeXeDBuDIwQShMgm21c4miCC6TSp+LMdpXh61QWP3WretDoeN56YZi71+Bl6xZr6YoxYkvMPDX2Vc7GjuzcbPRrCNeux7al7rAwwQsMEJJerQ5LGBI0cuASa97rDmb3xmGUdLlgqOqhr876DGeLh59ffuyP34Opyqzz0833LFHZnebHDMMMNpFHqSzKBMw36+DBD5v3SU9uydWJ33rZBOSlkoOV0EYLlCIMGlHKCKD5uwbIE7gofbe1RwRwiWINjDBRzKEXaDZDERGI8Nh7X1hFJABvS7ZA+is02VE8PO5C6jIAUNLjtyf5rdN9Ovmy8vjDz1K1o8hXN1Nc7MWQEGPcIc1EU7WyEeRGz4UvfMqlMWYrwhtGYA/YJIcmSO4uwRV4SV44ePf9PqZkTW/s+lOjftDpXVkrRWKEjYpMXlmE8EA5HHQDi9hw3NnXuhiHyYN45x0HMWk0cIYhm4S/Kz6m8xap0vvMHaPpQFbFERJXJr5iXYUxAFmlTiazjkJN143jabx5CC9g4I3+aO8g0qiz41KpQqRCl7dDJWyYHBjXAJKM5ey8xePH4V74Brc4zl0KRdH4J46CPcE4/MRTgdc4ErvlF1VsGJoEueZ2IXjdWUEEqv2R4rFl5NW70hacBN6qXN6plrN1DHMxvHDUIdB2lv+W2tcIf+tT3Z53DQx2c2xLSe7g+W6hgDSHzjwA+IslI3BBk5jiAMYC9CRJ06q+MQJRv9AboUgWTS4YeBHpLkkOELSP6f4BWRhdsdObALPO/mxzCBVkw1hE9DRJtpQNlGtdubCyLuji2CKY+jGcbDkFOwQJCUBI63vpTOFfNFGpl4l1TO1s3Tv1HoiRCEAUJOOJIZdA3jJkobEkFnfe+O8wxFJ5QiSPrcQ58VArlcnMrvlC73ljWY7/Xzihtvuzpfv4riv2QyK3FRZgOFyjRyDkilzfEcRSqfnaFIWxokG4OkjqCg5A0zgAE/qT83ma1fAq4GpAgHNF+wGURD5E80MaWB5xeTIp0fx7pUEIeof5DGUT1SejV9uNB61r6Dfa7NMXDr6w2BBSrOvrxJC6JbsHY6bTqntoNyIStg1RmhUCelG7GBgiiLRK5ieC+3VUgamubTh62oQMA8ckCVw7TGxFWN8IcDKSW1vUl/7N0i9nkrJPpieijn/NwKcRxJSFEli4v/IQrzL1FtM5kHDBcAOGeHQAZDHRCYr2rgBUPkwEdCpsUJjBBwZTXEPq0ueTC/5ZN5ynty/jTKPsGaGYhuWqmunv6BNM1TNGFE0QAf3GDxrBpxo2BLRcEal+YdJm3P7nSca46Ip7ul2EQ1ARcP5D4jGGTbKzmozxQalj96mGpppzCpXDKMh8sKesySks16cU7TD71ACycJblZHeGQoUkfMDgFJvjlqkSAjn6ps6LjT6kAfp/Wo3orUtVWP1Vr7ODoX0fi7bxtSp0qrK7UttjybKZgEzUPlorUrrcJeMqLSWYJ1xaw+UooKGvoWbkh5w+Zs47jVZb8U19Spz7TKubEOgtqJF0ZvGv7ssQYqMuG/+koL5LhXu5LAtWRBXp2TJihNk8sq/n+wv0xFXS2JpriiY3YUQwzh4YyGfgswIRuY15hPjns5F/DNmL3R6gtni3u5Kcqehdh7lKIsJZZfNxdtG2bBvDWUxVyAoz9UPj7SptiMNRkX6vPqFQRZIfM2nLclspFpqD4WKuFu9cCOPvmBwR4g8DYY655XMyOGnw6KSTBNs47qkevBfz5jcG3BLtsMp27IejGeS4rVEnt9cGTqbW5hblgS6UV1UFVPDZa2PXhk9h9tENiVVkyOj1+F9XGvVZGntZVqTyg8WLDvvGGbt1bqmSvnRuP0xYHmjzS8PLM6SXcsbeepYfCbQX32jfGkqriqI0C/SHoThKQHAFK23gPqLpjxBF8f0NbxyGq4oM0ekFrHwV/cVhsPlbrVue/nepdPo5FNlpgLbrlgr2wG4lE3ZELRaZUUMne1LmsWPatPhxW+TwcO/ -------------------------------------------------------------------------------- /examples/figures/SwissCovid/TrainingWindows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DhiriaDev/TIMEX/767841a830bdc6fafbe1702700b9f80175e357de/examples/figures/SwissCovid/TrainingWindows.png -------------------------------------------------------------------------------- /examples/historical_predictions/historical_predictions_bitcoin.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DhiriaDev/TIMEX/767841a830bdc6fafbe1702700b9f80175e357de/examples/historical_predictions/historical_predictions_bitcoin.pkl -------------------------------------------------------------------------------- /examples/historical_predictions/historical_predictions_swiss_covid_fbprophet.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DhiriaDev/TIMEX/767841a830bdc6fafbe1702700b9f80175e357de/examples/historical_predictions/historical_predictions_swiss_covid_fbprophet.pkl -------------------------------------------------------------------------------- /experiments/FreqEstimator/AirlinePassengers.csv: -------------------------------------------------------------------------------- 1 | Month,Passengers 2 | 1980-01,112 3 | 1980-02,118 4 | 1980-03,132 5 | 1980-04,129 6 | 1980-05,121 7 | 1980-06,135 8 | 1980-07,148 9 | 1980-08,148 10 | 1980-09,136 11 | 1980-10,119 12 | 1980-11,104 13 | 1980-12,118 14 | 1981-01,115 15 | 1981-02,126 16 | 1981-03,141 17 | 1981-04,135 18 | 1981-05,125 19 | 1981-06,149 20 | 1981-07,170 21 | 1981-08,170 22 | 1981-09,158 23 | 1981-10,133 24 | 1981-11,114 25 | 1981-12,140 26 | 1982-01,145 27 | 1982-02,150 28 | 1982-03,178 29 | 1982-04,163 30 | 1982-05,172 31 | 1982-06,178 32 | 1982-07,199 33 | 1982-08,199 34 | 1982-09,184 35 | 1982-10,162 36 | 1982-11,146 37 | 1982-12,166 38 | 1983-01,171 39 | 1983-02,180 40 | 1983-03,193 41 | 1983-04,181 42 | 1983-05,183 43 | 1983-06,218 44 | 1983-07,230 45 | 1983-08,242 46 | 1983-09,209 47 | 1983-10,191 48 | 1983-11,172 49 | 1983-12,194 50 | 1984-01,196 51 | 1984-02,196 52 | 1984-03,236 53 | 1984-04,235 54 | 1984-05,229 55 | 1984-06,243 56 | 1984-07,264 57 | 1984-08,272 58 | 1984-09,237 59 | 1984-10,211 60 | 1984-11,180 61 | 1984-12,201 62 | 1985-01,204 63 | 1985-02,188 64 | 1985-03,235 65 | 1985-04,227 66 | 1985-05,234 67 | 1985-06,264 68 | 1985-07,302 69 | 1985-08,293 70 | 1985-09,259 71 | 1985-10,229 72 | 1985-11,203 73 | 1985-12,229 74 | 1986-01,242 75 | 1986-02,233 76 | 1986-03,267 77 | 1986-04,269 78 | 1986-05,270 79 | 1986-06,315 80 | 1986-07,364 81 | 1986-08,347 82 | 1986-09,312 83 | 1986-10,274 84 | 1986-11,237 85 | 1986-12,278 86 | 1987-01,284 87 | 1987-02,277 88 | 1987-03,317 89 | 1987-04,313 90 | 1987-05,318 91 | 1987-06,374 92 | 1987-07,413 93 | 1987-08,405 94 | 1987-09,355 95 | 1987-10,306 96 | 1987-11,271 97 | 1987-12,306 98 | 1988-01,315 99 | 1988-02,301 100 | 1988-03,356 101 | 1988-04,348 102 | 1988-05,355 103 | 1988-06,422 104 | 1988-07,465 105 | 1988-08,467 106 | 1988-09,404 107 | 1988-10,347 108 | 1988-11,305 109 | 1988-12,336 110 | 1989-01,340 111 | 1989-02,318 112 | 1989-03,362 113 | 1989-04,348 114 | 1989-05,363 115 | 1989-06,435 116 | 1989-07,491 117 | 1989-08,505 118 | 1989-09,404 119 | 1989-10,359 120 | 1989-11,310 121 | 1989-12,337 122 | 1990-01,360 123 | 1990-02,342 124 | 1990-03,406 125 | 1990-04,396 126 | 1990-05,420 127 | 1990-06,472 128 | 1990-07,548 129 | 1990-08,559 130 | 1990-09,463 131 | 1990-10,407 132 | 1990-11,362 133 | 1990-12,405 134 | -------------------------------------------------------------------------------- /experiments/FreqEstimator/BrentOil.csv: -------------------------------------------------------------------------------- 1 | Date,Close/Last 2 | 04/11/2023,85.61 3 | 04/10/2023,84.18 4 | 04/06/2023,85.12 5 | 04/05/2023,84.99 6 | 04/04/2023,84.94 7 | 04/03/2023,84.93 8 | 03/31/2023,79.77 9 | 03/30/2023,79.27 10 | 03/29/2023,78.28 11 | 03/28/2023,78.65 12 | 03/27/2023,78.12 13 | 03/24/2023,74.99 14 | 03/23/2023,75.91 15 | 03/22/2023,76.69 16 | 03/21/2023,75.32 17 | 03/20/2023,73.79 18 | 03/17/2023,72.97 19 | 03/16/2023,74.7 20 | 03/15/2023,73.69 21 | 03/14/2023,77.45 22 | 03/13/2023,80.77 23 | 03/10/2023,82.78 24 | 03/09/2023,81.59 25 | 03/08/2023,82.66 26 | 03/07/2023,83.29 27 | 03/06/2023,86.18 28 | 03/03/2023,85.83 29 | 03/02/2023,84.75 30 | 03/01/2023,84.31 31 | 02/28/2023,83.89 32 | 02/27/2023,82.45 33 | 02/24/2023,83.16 34 | 02/23/2023,82.21 35 | 02/22/2023,80.6 36 | 02/21/2023,83.05 37 | 02/17/2023,83.0 38 | 02/16/2023,85.14 39 | 02/15/2023,85.38 40 | 02/14/2023,85.58 41 | 02/13/2023,86.61 42 | 02/10/2023,86.39 43 | 02/09/2023,84.5 44 | 02/08/2023,85.09 45 | 02/07/2023,83.69 46 | 02/06/2023,80.99 47 | 02/03/2023,79.94 48 | 02/02/2023,82.17 49 | 02/01/2023,82.84 50 | 01/31/2023,84.49 51 | 01/30/2023,84.9 52 | 01/27/2023,86.66 53 | 01/26/2023,87.47 54 | 01/25/2023,86.12 55 | 01/24/2023,86.13 56 | 01/23/2023,88.19 57 | 01/20/2023,87.63 58 | 01/19/2023,86.16 59 | 01/18/2023,84.98 60 | 01/17/2023,85.92 61 | 01/13/2023,85.28 62 | 01/12/2023,84.03 63 | 01/11/2023,82.67 64 | 01/10/2023,80.1 65 | 01/09/2023,79.65 66 | 01/06/2023,78.57 67 | 01/05/2023,78.69 68 | 01/04/2023,77.84 69 | 01/03/2023,82.1 70 | 12/30/2022,85.91 71 | 12/29/2022,82.26 72 | 12/28/2022,83.26 73 | 12/27/2022,84.33 74 | 12/23/2022,83.92 75 | 12/22/2022,80.98 76 | 12/21/2022,82.2 77 | 12/20/2022,79.99 78 | 12/19/2022,79.8 79 | 12/16/2022,79.04 80 | 12/15/2022,81.21 81 | 12/14/2022,82.7 82 | 12/13/2022,80.68 83 | 12/12/2022,77.99 84 | 12/09/2022,76.1 85 | 12/08/2022,76.15 86 | 12/07/2022,77.17 87 | 12/06/2022,79.35 88 | 12/05/2022,82.68 89 | 12/02/2022,85.57 90 | 12/01/2022,86.88 91 | 11/30/2022,85.43 92 | 11/29/2022,83.03 93 | 11/28/2022,83.19 94 | 11/25/2022,83.63 95 | 11/23/2022,85.41 96 | 11/22/2022,88.36 97 | 11/21/2022,87.45 98 | 11/18/2022,87.62 99 | 11/17/2022,89.78 100 | 11/16/2022,92.86 101 | 11/15/2022,93.86 102 | 11/14/2022,93.14 103 | 11/11/2022,95.99 104 | 11/10/2022,93.67 105 | 11/09/2022,92.65 106 | 11/08/2022,95.36 107 | 11/07/2022,97.92 108 | 11/04/2022,98.57 109 | 11/03/2022,94.67 110 | 11/02/2022,96.16 111 | 11/01/2022,94.65 112 | 10/31/2022,94.83 113 | 10/28/2022,95.77 114 | 10/27/2022,96.96 115 | 10/26/2022,95.69 116 | 10/25/2022,93.52 117 | 10/24/2022,93.26 118 | 10/21/2022,93.5 119 | 10/20/2022,92.38 120 | 10/19/2022,92.41 121 | 10/18/2022,90.03 122 | 10/17/2022,91.62 123 | 10/14/2022,91.63 124 | 10/13/2022,94.57 125 | 10/12/2022,92.45 126 | 10/11/2022,94.29 127 | 10/10/2022,96.19 128 | 10/07/2022,97.92 129 | 10/06/2022,94.42 130 | 10/05/2022,93.37 131 | 10/04/2022,91.8 132 | 10/03/2022,88.86 133 | 09/30/2022,87.96 134 | 09/29/2022,88.49 135 | 09/28/2022,89.32 136 | 09/27/2022,86.27 137 | 09/26/2022,84.06 138 | 09/23/2022,86.15 139 | 09/22/2022,90.46 140 | 09/21/2022,89.83 141 | 09/20/2022,90.62 142 | 09/19/2022,92.0 143 | 09/16/2022,91.35 144 | 09/15/2022,90.84 145 | 09/14/2022,94.1 146 | 09/13/2022,93.17 147 | 09/12/2022,94.0 148 | 09/09/2022,92.84 149 | 09/08/2022,89.15 150 | 09/07/2022,88.0 151 | 09/06/2022,92.83 152 | 09/02/2022,93.02 153 | 09/01/2022,92.36 154 | 08/31/2022,96.49 155 | 08/30/2022,99.31 156 | 08/29/2022,105.09 157 | 08/26/2022,100.99 158 | 08/25/2022,99.34 159 | 08/24/2022,101.22 160 | 08/23/2022,100.22 161 | 08/22/2022,96.48 162 | 08/19/2022,96.72 163 | 08/18/2022,96.59 164 | 08/17/2022,93.65 165 | 08/16/2022,92.34 166 | 08/15/2022,95.1 167 | 08/12/2022,98.15 168 | 08/11/2022,99.6 169 | 08/10/2022,97.4 170 | 08/09/2022,96.31 171 | 08/08/2022,96.65 172 | 08/05/2022,94.92 173 | 08/04/2022,94.12 174 | 08/03/2022,96.78 175 | 08/02/2022,100.54 176 | 08/01/2022,100.03 177 | 07/29/2022,103.97 178 | 07/28/2022,107.14 179 | 07/27/2022,106.62 180 | 07/26/2022,104.4 181 | 07/25/2022,105.15 182 | 07/22/2022,103.2 183 | 07/21/2022,103.86 184 | 07/20/2022,106.92 185 | 07/19/2022,107.35 186 | 07/18/2022,106.27 187 | 07/15/2022,101.16 188 | 07/14/2022,99.1 189 | 07/13/2022,99.57 190 | 07/12/2022,99.49 191 | 07/11/2022,107.1 192 | 07/08/2022,107.02 193 | 07/07/2022,104.65 194 | 07/06/2022,100.69 195 | 07/05/2022,102.77 196 | 07/01/2022,111.63 197 | 06/30/2022,114.81 198 | 06/29/2022,116.26 199 | 06/28/2022,117.98 200 | 06/27/2022,115.09 201 | 06/24/2022,113.12 202 | 06/23/2022,110.05 203 | 06/22/2022,111.74 204 | 06/21/2022,114.65 205 | 06/17/2022,113.12 206 | 06/16/2022,119.81 207 | 06/15/2022,118.51 208 | 06/14/2022,121.17 209 | 06/13/2022,122.27 210 | 06/10/2022,122.01 211 | 06/09/2022,123.07 212 | 06/08/2022,123.58 213 | 06/07/2022,120.57 214 | 06/06/2022,119.51 215 | 06/03/2022,119.72 216 | 06/02/2022,117.61 217 | 06/01/2022,116.29 218 | 05/31/2022,122.84 219 | 05/27/2022,119.43 220 | 05/26/2022,117.4 221 | 05/25/2022,114.03 222 | 05/24/2022,113.56 223 | 05/23/2022,113.42 224 | 05/20/2022,112.55 225 | 05/19/2022,112.04 226 | 05/18/2022,109.11 227 | 05/17/2022,111.93 228 | 05/16/2022,114.24 229 | 05/13/2022,111.55 230 | 05/12/2022,107.45 231 | 05/11/2022,107.51 232 | 05/10/2022,102.46 233 | 05/09/2022,105.94 234 | 05/06/2022,112.39 235 | 05/05/2022,110.9 236 | 05/04/2022,110.14 237 | 05/03/2022,104.97 238 | 05/02/2022,107.58 239 | 04/29/2022,109.34 240 | 04/28/2022,107.59 241 | 04/27/2022,105.32 242 | 04/26/2022,104.99 243 | 04/25/2022,102.32 244 | 04/22/2022,106.65 245 | 04/21/2022,108.33 246 | 04/20/2022,106.8 247 | 04/19/2022,107.25 248 | 04/18/2022,113.16 249 | 04/14/2022,111.7 250 | 04/13/2022,108.78 251 | 04/12/2022,104.64 252 | 04/11/2022,98.48 253 | 04/08/2022,102.78 254 | 04/07/2022,100.58 255 | 04/06/2022,101.07 256 | 04/05/2022,106.64 257 | 04/04/2022,107.53 258 | 04/01/2022,104.39 259 | 03/31/2022,107.91 260 | 03/30/2022,113.45 261 | 03/29/2022,110.23 262 | 03/28/2022,112.48 263 | 03/25/2022,120.65 264 | 03/24/2022,119.03 265 | 03/23/2022,121.6 266 | 03/22/2022,115.48 267 | 03/21/2022,115.62 268 | 03/18/2022,107.93 269 | 03/17/2022,106.64 270 | 03/16/2022,98.02 271 | 03/15/2022,99.91 272 | 03/14/2022,106.9 273 | 03/11/2022,112.67 274 | 03/10/2022,109.33 275 | 03/09/2022,111.14 276 | 03/08/2022,127.98 277 | 03/07/2022,123.21 278 | 03/04/2022,118.11 279 | 03/03/2022,110.46 280 | 03/02/2022,112.93 281 | 03/01/2022,104.97 282 | 02/28/2022,100.99 283 | 02/25/2022,97.93 284 | 02/24/2022,99.08 285 | 02/23/2022,97.13 286 | 02/22/2022,96.84 287 | 02/18/2022,93.54 288 | 02/17/2022,92.97 289 | 02/16/2022,94.81 290 | 02/15/2022,93.28 291 | 02/14/2022,96.48 292 | 02/11/2022,94.44 293 | 02/10/2022,91.41 294 | 02/09/2022,91.55 295 | 02/08/2022,90.78 296 | 02/07/2022,92.69 297 | 02/04/2022,93.27 298 | 02/03/2022,91.11 299 | 02/02/2022,89.47 300 | 02/01/2022,89.16 301 | 01/31/2022,91.21 302 | 01/28/2022,90.03 303 | 01/27/2022,89.34 304 | 01/26/2022,89.96 305 | 01/25/2022,88.2 306 | 01/24/2022,86.27 307 | 01/21/2022,87.89 308 | 01/20/2022,88.38 309 | 01/19/2022,88.44 310 | 01/18/2022,87.51 311 | 01/14/2022,86.06 312 | 01/13/2022,84.47 313 | 01/12/2022,84.67 314 | 01/11/2022,83.72 315 | 01/10/2022,80.87 316 | 01/07/2022,81.75 317 | 01/06/2022,81.99 318 | 01/05/2022,80.8 319 | 01/04/2022,80.0 320 | 01/03/2022,78.98 321 | 12/31/2021,77.78 322 | 12/30/2021,79.32 323 | 12/29/2021,79.23 324 | 12/28/2021,78.94 325 | 12/27/2021,78.6 326 | 12/23/2021,76.85 327 | 12/22/2021,75.29 328 | 12/21/2021,73.98 329 | 12/20/2021,71.52 330 | 12/17/2021,73.52 331 | 12/16/2021,75.02 332 | 12/15/2021,73.88 333 | 12/14/2021,73.7 334 | 12/13/2021,74.39 335 | 12/10/2021,75.15 336 | 12/09/2021,74.42 337 | 12/08/2021,75.82 338 | 12/07/2021,75.44 339 | 12/06/2021,73.08 340 | 12/03/2021,69.88 341 | 12/02/2021,69.67 342 | 12/01/2021,68.87 343 | 11/30/2021,70.57 344 | 11/29/2021,73.44 345 | 11/26/2021,72.72 346 | 11/24/2021,82.25 347 | 11/23/2021,82.31 348 | 11/22/2021,79.7 349 | 11/19/2021,78.89 350 | 11/18/2021,81.24 351 | 11/17/2021,80.28 352 | 11/16/2021,82.43 353 | 11/15/2021,82.05 354 | 11/12/2021,82.17 355 | 11/11/2021,82.87 356 | 11/10/2021,82.64 357 | 11/09/2021,84.78 358 | 11/08/2021,83.43 359 | 11/05/2021,82.74 360 | 11/04/2021,80.54 361 | 11/03/2021,81.99 362 | 11/02/2021,84.72 363 | 11/01/2021,84.71 364 | 10/29/2021,84.38 365 | 10/28/2021,84.32 366 | 10/27/2021,84.58 367 | 10/26/2021,86.4 368 | 10/25/2021,85.99 369 | 10/22/2021,85.53 370 | 10/21/2021,84.61 371 | 10/20/2021,85.82 372 | 10/19/2021,85.08 373 | 10/18/2021,84.33 374 | 10/15/2021,84.86 375 | 10/14/2021,84.0 376 | 10/13/2021,83.18 377 | 10/12/2021,83.42 378 | 10/11/2021,83.65 379 | 10/08/2021,82.39 380 | 10/07/2021,81.95 381 | 10/06/2021,81.08 382 | 10/05/2021,82.56 383 | 10/04/2021,81.26 384 | 10/01/2021,79.28 385 | 09/30/2021,78.52 386 | 09/29/2021,78.64 387 | 09/28/2021,79.09 388 | 09/27/2021,79.53 389 | 09/24/2021,78.09 390 | 09/23/2021,77.25 391 | 09/22/2021,76.19 392 | 09/21/2021,74.36 393 | 09/20/2021,73.92 394 | 09/17/2021,75.34 395 | 09/16/2021,75.67 396 | 09/15/2021,75.46 397 | 09/14/2021,73.6 398 | 09/13/2021,73.51 399 | 09/10/2021,72.92 400 | 09/09/2021,71.45 401 | 09/08/2021,72.6 402 | 09/07/2021,71.69 403 | 09/03/2021,72.61 404 | 09/02/2021,73.03 405 | 09/01/2021,71.59 406 | 08/31/2021,72.99 407 | 08/30/2021,73.41 408 | 08/27/2021,72.7 409 | 08/26/2021,71.07 410 | 08/25/2021,72.25 411 | 08/24/2021,71.05 412 | 08/23/2021,68.75 413 | 08/20/2021,65.18 414 | 08/19/2021,66.45 415 | 08/18/2021,68.23 416 | 08/17/2021,69.03 417 | 08/16/2021,69.51 418 | 08/13/2021,70.59 419 | 08/12/2021,71.31 420 | 08/11/2021,71.44 421 | 08/10/2021,70.63 422 | 08/09/2021,69.04 423 | 08/06/2021,70.7 424 | 08/05/2021,71.29 425 | 08/04/2021,70.38 426 | 08/03/2021,72.41 427 | 08/02/2021,72.89 428 | 07/30/2021,76.33 429 | 07/29/2021,76.05 430 | 07/28/2021,74.74 431 | 07/27/2021,74.48 432 | 07/26/2021,74.5 433 | 07/23/2021,74.1 434 | 07/22/2021,73.79 435 | 07/21/2021,72.23 436 | 07/20/2021,69.35 437 | 07/19/2021,68.62 438 | 07/16/2021,73.59 439 | 07/15/2021,73.47 440 | 07/14/2021,74.76 441 | 07/13/2021,76.49 442 | 07/12/2021,75.16 443 | 07/09/2021,75.55 444 | 07/08/2021,74.12 445 | 07/07/2021,73.43 446 | 07/06/2021,74.53 447 | 07/02/2021,76.17 448 | 07/01/2021,75.84 449 | 06/30/2021,75.13 450 | 06/29/2021,74.76 451 | 06/28/2021,74.68 452 | 06/25/2021,76.18 453 | 06/24/2021,75.56 454 | 06/23/2021,75.19 455 | 06/22/2021,74.81 456 | 06/21/2021,74.9 457 | 06/18/2021,73.51 458 | 06/17/2021,73.08 459 | 06/16/2021,74.39 460 | 06/15/2021,73.99 461 | 06/14/2021,72.86 462 | 06/11/2021,72.69 463 | 06/10/2021,72.52 464 | 06/09/2021,72.03 465 | 06/08/2021,72.22 466 | 06/07/2021,71.49 467 | 06/04/2021,71.89 468 | 06/03/2021,71.31 469 | 06/02/2021,71.35 470 | 06/01/2021,70.25 471 | 05/28/2021,69.63 472 | 05/27/2021,69.46 473 | 05/26/2021,68.87 474 | 05/25/2021,68.65 475 | 05/24/2021,68.46 476 | 05/21/2021,66.44 477 | 05/20/2021,65.11 478 | 05/19/2021,66.66 479 | 05/18/2021,68.71 480 | 05/17/2021,69.46 481 | 05/14/2021,68.71 482 | 05/13/2021,67.05 483 | 05/12/2021,69.32 484 | 05/11/2021,68.55 485 | 05/10/2021,68.32 486 | 05/07/2021,68.28 487 | 05/06/2021,68.09 488 | 05/05/2021,68.96 489 | 05/04/2021,68.88 490 | 05/03/2021,67.56 491 | 04/30/2021,67.25 492 | 04/29/2021,68.56 493 | 04/28/2021,67.27 494 | 04/27/2021,66.42 495 | 04/26/2021,65.65 496 | 04/23/2021,66.11 497 | 04/22/2021,65.4 498 | 04/21/2021,65.32 499 | 04/20/2021,66.57 500 | 04/19/2021,67.05 501 | 04/16/2021,66.77 502 | -------------------------------------------------------------------------------- /experiments/FreqEstimator/Covid.csv: -------------------------------------------------------------------------------- 1 | Data,Nuovi casi 2 | 2020-02-25,93 3 | 2020-02-26,78 4 | 2020-02-27,250 5 | 2020-02-28,238 6 | 2020-02-29,240 7 | 2020-03-01,566 8 | 2020-03-02,342 9 | 2020-03-03,466 10 | 2020-03-04,587 11 | 2020-03-05,769 12 | 2020-03-06,778 13 | 2020-03-07,1247 14 | 2020-03-08,1492 15 | 2020-03-09,1797 16 | 2020-03-10,977 17 | 2020-03-11,2313 18 | 2020-03-12,2651 19 | 2020-03-13,2547 20 | 2020-03-14,3497 21 | 2020-03-15,3590 22 | 2020-03-16,3233 23 | 2020-03-17,3526 24 | 2020-03-18,4207 25 | 2020-03-19,5322 26 | 2020-03-20,5986 27 | 2020-03-21,6557 28 | 2020-03-22,5560 29 | 2020-03-23,4789 30 | 2020-03-24,5249 31 | 2020-03-25,5210 32 | 2020-03-26,6153 33 | 2020-03-27,5959 34 | 2020-03-28,5974 35 | 2020-03-29,5217 36 | 2020-03-30,4050 37 | 2020-03-31,4053 38 | 2020-04-01,4782 39 | 2020-04-02,4668 40 | 2020-04-03,4585 41 | 2020-04-04,4805 42 | 2020-04-05,4316 43 | 2020-04-06,3599 44 | 2020-04-07,3039 45 | 2020-04-08,3836 46 | 2020-04-09,4204 47 | 2020-04-10,3951 48 | 2020-04-11,4694 49 | 2020-04-12,4092 50 | 2020-04-13,3153 51 | 2020-04-14,2972 52 | 2020-04-15,2667 53 | 2020-04-16,3786 54 | 2020-04-17,3493 55 | 2020-04-18,3491 56 | 2020-04-19,3047 57 | 2020-04-20,2256 58 | 2020-04-21,2729 59 | 2020-04-22,3370 60 | 2020-04-23,2646 61 | 2020-04-24,3021 62 | 2020-04-25,2357 63 | 2020-04-26,2324 64 | 2020-04-27,1739 65 | 2020-04-28,2091 66 | 2020-04-29,2086 67 | 2020-04-30,1872 68 | 2020-05-01,1965 69 | 2020-05-02,1900 70 | 2020-05-03,1389 71 | 2020-05-04,1221 72 | 2020-05-05,1075 73 | 2020-05-06,1444 74 | 2020-05-07,1401 75 | 2020-05-08,1327 76 | 2020-05-09,1083 77 | 2020-05-10,802 78 | 2020-05-11,744 79 | 2020-05-12,1402 80 | 2020-05-13,888 81 | 2020-05-14,992 82 | 2020-05-15,789 83 | 2020-05-16,875 84 | 2020-05-17,675 85 | 2020-05-18,451 86 | 2020-05-19,813 87 | 2020-05-20,665 88 | 2020-05-21,642 89 | 2020-05-22,652 90 | 2020-05-23,669 91 | 2020-05-24,531 92 | 2020-05-25,300 93 | 2020-05-26,397 94 | 2020-05-27,584 95 | 2020-05-28,593 96 | 2020-05-29,516 97 | 2020-05-30,416 98 | 2020-05-31,355 99 | 2020-06-01,178 100 | 2020-06-02,318 101 | 2020-06-03,321 102 | 2020-06-04,177 103 | 2020-06-05,518 104 | 2020-06-06,270 105 | 2020-06-07,197 106 | 2020-06-08,280 107 | 2020-06-09,283 108 | 2020-06-10,202 109 | 2020-06-11,379 110 | 2020-06-12,163 111 | 2020-06-13,346 112 | 2020-06-14,338 113 | 2020-06-15,303 114 | 2020-06-16,210 115 | 2020-06-17,329 116 | 2020-06-18,333 117 | 2020-06-19,251 118 | 2020-06-20,262 119 | 2020-06-21,224 120 | 2020-06-22,218 121 | 2020-06-23,122 122 | 2020-06-24,190 123 | 2020-06-25,296 124 | 2020-06-26,259 125 | 2020-06-27,175 126 | 2020-06-28,174 127 | 2020-06-29,126 128 | 2020-06-30,142 129 | 2020-07-01,187 130 | 2020-07-02,201 131 | 2020-07-03,223 132 | 2020-07-04,235 133 | 2020-07-05,192 134 | 2020-07-06,208 135 | 2020-07-07,138 136 | 2020-07-08,193 137 | 2020-07-09,229 138 | 2020-07-10,276 139 | 2020-07-11,188 140 | 2020-07-12,234 141 | 2020-07-13,169 142 | 2020-07-14,114 143 | 2020-07-15,163 144 | 2020-07-16,230 145 | 2020-07-17,233 146 | 2020-07-18,249 147 | 2020-07-19,219 148 | 2020-07-20,190 149 | 2020-07-21,129 150 | 2020-07-22,282 151 | 2020-07-23,306 152 | 2020-07-24,252 153 | 2020-07-25,275 154 | 2020-07-26,255 155 | 2020-07-27,170 156 | 2020-07-28,212 157 | 2020-07-29,289 158 | 2020-07-30,386 159 | 2020-07-31,379 160 | 2020-08-01,295 161 | 2020-08-02,239 162 | 2020-08-03,159 163 | 2020-08-04,190 164 | 2020-08-05,384 165 | 2020-08-06,402 166 | 2020-08-07,552 167 | 2020-08-08,347 168 | 2020-08-09,463 169 | 2020-08-10,259 170 | 2020-08-11,412 171 | 2020-08-12,481 172 | 2020-08-13,523 173 | 2020-08-14,574 174 | 2020-08-15,629 175 | 2020-08-16,479 176 | 2020-08-17,320 177 | 2020-08-18,403 178 | 2020-08-19,642 179 | 2020-08-20,845 180 | 2020-08-21,947 181 | 2020-08-22,1071 182 | 2020-08-23,1210 183 | 2020-08-24,953 184 | 2020-08-25,878 185 | 2020-08-26,1367 186 | 2020-08-27,1411 187 | 2020-08-28,1462 188 | 2020-08-29,1444 189 | 2020-08-30,1365 190 | 2020-08-31,996 191 | 2020-09-01,978 192 | 2020-09-02,1326 193 | 2020-09-03,1397 194 | 2020-09-04,1733 195 | 2020-09-05,1694 196 | 2020-09-06,1297 197 | 2020-09-07,1108 198 | 2020-09-08,1370 199 | 2020-09-09,1434 200 | 2020-09-10,1597 201 | 2020-09-11,1616 202 | 2020-09-12,1501 203 | 2020-09-13,1458 204 | 2020-09-14,1008 205 | 2020-09-15,1229 206 | 2020-09-16,1452 207 | 2020-09-17,1585 208 | 2020-09-18,1907 209 | 2020-09-19,1638 210 | 2020-09-20,1587 211 | 2020-09-21,1350 212 | 2020-09-22,1392 213 | 2020-09-23,1640 214 | 2020-09-24,1786 215 | 2020-09-25,1912 216 | 2020-09-26,1869 217 | 2020-09-27,1766 218 | 2020-09-28,1494 219 | 2020-09-29,1648 220 | 2020-09-30,1851 221 | 2020-10-01,2548 222 | 2020-10-02,2499 223 | 2020-10-03,2844 224 | 2020-10-04,2578 225 | 2020-10-05,2257 226 | 2020-10-06,2677 227 | 2020-10-07,3678 228 | 2020-10-08,4458 229 | 2020-10-09,5372 230 | 2020-10-10,5724 231 | 2020-10-11,5456 232 | 2020-10-12,4619 233 | 2020-10-13,5901 234 | 2020-10-14,7332 235 | 2020-10-15,8804 236 | 2020-10-16,10010 237 | 2020-10-17,10925 238 | 2020-10-18,11705 239 | 2020-10-19,9338 240 | 2020-10-20,10874 241 | 2020-10-21,15199 242 | 2020-10-22,16079 243 | 2020-10-23,19143 244 | 2020-10-24,19644 245 | 2020-10-25,21273 246 | 2020-10-26,17012 247 | 2020-10-27,21994 248 | 2020-10-28,24991 249 | 2020-10-29,26831 250 | 2020-10-30,31084 251 | 2020-10-31,31758 252 | 2020-11-01,29907 253 | 2020-11-02,22253 254 | 2020-11-03,28244 255 | 2020-11-04,30550 256 | 2020-11-05,34505 257 | 2020-11-06,37809 258 | 2020-11-07,39811 259 | 2020-11-08,32616 260 | 2020-11-09,25271 261 | 2020-11-10,35098 262 | 2020-11-11,32961 263 | 2020-11-12,37978 264 | 2020-11-13,40902 265 | 2020-11-14,37255 266 | 2020-11-15,33979 267 | 2020-11-16,27354 268 | 2020-11-17,32191 269 | 2020-11-18,34282 270 | 2020-11-19,36176 271 | 2020-11-20,37242 272 | 2020-11-21,34767 273 | 2020-11-22,28337 274 | 2020-11-23,22930 275 | 2020-11-24,23232 276 | 2020-11-25,25853 277 | 2020-11-26,29003 278 | 2020-11-27,28352 279 | 2020-11-28,26323 280 | 2020-11-29,20648 281 | 2020-11-30,16377 282 | 2020-12-01,19350 283 | 2020-12-02,20709 284 | 2020-12-03,23225 285 | 2020-12-04,24099 286 | 2020-12-05,21052 287 | 2020-12-06,18887 288 | 2020-12-07,13720 289 | 2020-12-08,14842 290 | 2020-12-09,12756 291 | 2020-12-10,16999 292 | 2020-12-11,18727 293 | 2020-12-12,19903 294 | 2020-12-13,17938 295 | 2020-12-14,12030 296 | 2020-12-15,14844 297 | 2020-12-16,17572 298 | 2020-12-17,18236 299 | 2020-12-18,17992 300 | 2020-12-19,16308 301 | 2020-12-20,15104 302 | 2020-12-21,10872 303 | 2020-12-22,13318 304 | 2020-12-23,14522 305 | 2020-12-24,18040 306 | 2020-12-25,19037 307 | 2020-12-26,10431 308 | 2020-12-27,8913 309 | 2020-12-28,8585 310 | 2020-12-29,11224 311 | 2020-12-30,16202 312 | 2020-12-31,23477 313 | 2021-01-01,22211 314 | 2021-01-02,11831 315 | 2021-01-03,14245 316 | 2021-01-04,10800 317 | 2021-01-05,15378 318 | 2021-01-06,20331 319 | 2021-01-07,18020 320 | 2021-01-08,17533 321 | 2021-01-09,19978 322 | 2021-01-10,18627 323 | 2021-01-11,12532 324 | 2021-01-12,14242 325 | 2021-01-13,15774 326 | 2021-01-14,17246 327 | 2021-01-15,16146 328 | 2021-01-16,16310 329 | 2021-01-17,12545 330 | 2021-01-18,8825 331 | 2021-01-19,10497 332 | 2021-01-20,13571 333 | 2021-01-21,14078 334 | 2021-01-22,13633 335 | 2021-01-23,13331 336 | 2021-01-24,11629 337 | 2021-01-25,8562 338 | 2021-01-26,10593 339 | 2021-01-27,15204 340 | 2021-01-28,14372 341 | 2021-01-29,13574 342 | 2021-01-30,12715 343 | 2021-01-31,11252 344 | 2021-02-01,7925 345 | 2021-02-02,9660 346 | 2021-02-03,13189 347 | 2021-02-04,13659 348 | 2021-02-05,14218 349 | 2021-02-06,13442 350 | 2021-02-07,11641 351 | 2021-02-08,7970 352 | 2021-02-09,10630 353 | 2021-02-10,12956 354 | 2021-02-11,15146 355 | 2021-02-12,13908 356 | 2021-02-13,13532 357 | 2021-02-14,11068 358 | 2021-02-15,7351 359 | 2021-02-16,10386 360 | 2021-02-17,12074 361 | 2021-02-18,13762 362 | 2021-02-19,15479 363 | 2021-02-20,14931 364 | 2021-02-21,13452 365 | 2021-02-22,9630 366 | 2021-02-23,13314 367 | 2021-02-24,16424 368 | 2021-02-25,19886 369 | 2021-02-26,20499 370 | 2021-02-27,18916 371 | 2021-02-28,17455 372 | 2021-03-01,13114 373 | 2021-03-02,17083 374 | 2021-03-03,20884 375 | 2021-03-04,22865 376 | 2021-03-05,24036 377 | 2021-03-06,23641 378 | 2021-03-07,20765 379 | 2021-03-08,13902 380 | 2021-03-09,19749 381 | 2021-03-10,22409 382 | 2021-03-11,25673 383 | 2021-03-12,26824 384 | 2021-03-13,26062 385 | 2021-03-14,21315 386 | 2021-03-15,15267 387 | 2021-03-16,20396 388 | 2021-03-17,23059 389 | 2021-03-18,24935 390 | 2021-03-19,25735 391 | 2021-03-20,23832 392 | 2021-03-21,20159 393 | 2021-03-22,13846 394 | 2021-03-23,18765 395 | 2021-03-24,21267 396 | 2021-03-25,23798 397 | 2021-03-26,23987 398 | 2021-03-27,23776 399 | 2021-03-28,19611 400 | 2021-03-29,12916 401 | 2021-03-30,16013 402 | 2021-03-31,22516 403 | 2021-04-01,23649 404 | 2021-04-02,21932 405 | 2021-04-03,21261 406 | 2021-04-04,18025 407 | 2021-04-05,10680 408 | 2021-04-06,7767 409 | 2021-04-07,13708 410 | 2021-04-08,17221 411 | 2021-04-09,18938 412 | 2021-04-10,17567 413 | 2021-04-11,15746 414 | 2021-04-12,9789 415 | 2021-04-13,13447 416 | 2021-04-14,16168 417 | 2021-04-15,16974 418 | 2021-04-16,15943 419 | 2021-04-17,15370 420 | 2021-04-18,12694 421 | 2021-04-19,8864 422 | 2021-04-20,12074 423 | 2021-04-21,13844 424 | 2021-04-22,16050 425 | 2021-04-23,14761 426 | 2021-04-24,13817 427 | 2021-04-25,13158 428 | 2021-04-26,8444 429 | 2021-04-27,10404 430 | 2021-04-28,13385 431 | 2021-04-29,14320 432 | 2021-04-30,13446 433 | 2021-05-01,12965 434 | 2021-05-02,9148 435 | 2021-05-03,5948 436 | 2021-05-04,9116 437 | 2021-05-05,10585 438 | 2021-05-06,11807 439 | 2021-05-07,10554 440 | 2021-05-08,10176 441 | 2021-05-09,8292 442 | 2021-05-10,5080 443 | 2021-05-11,6946 444 | 2021-05-12,7852 445 | 2021-05-13,8085 446 | 2021-05-14,7567 447 | 2021-05-15,6659 448 | 2021-05-16,5753 449 | 2021-05-17,3455 450 | 2021-05-18,4452 451 | 2021-05-19,5506 452 | 2021-05-20,5741 453 | 2021-05-21,5218 454 | 2021-05-22,4717 455 | 2021-05-23,3995 456 | 2021-05-24,2490 457 | 2021-05-25,3224 458 | 2021-05-26,3937 459 | 2021-05-27,4147 460 | 2021-05-28,3738 461 | 2021-05-29,3351 462 | 2021-05-30,2949 463 | 2021-05-31,1820 464 | 2021-06-01,2483 465 | 2021-06-02,2897 466 | 2021-06-03,1968 467 | 2021-06-04,2557 468 | 2021-06-05,2436 469 | 2021-06-06,2275 470 | 2021-06-07,1273 471 | 2021-06-08,1896 472 | 2021-06-09,2199 473 | 2021-06-10,2079 474 | 2021-06-11,1901 475 | 2021-06-12,1723 476 | 2021-06-13,1390 477 | 2021-06-14,907 478 | 2021-06-15,1255 479 | 2021-06-16,1400 480 | 2021-06-17,1325 481 | 2021-06-18,1147 482 | 2021-06-19,1197 483 | 2021-06-20,881 484 | 2021-06-21,495 485 | 2021-06-22,835 486 | 2021-06-23,951 487 | 2021-06-24,927 488 | 2021-06-25,753 489 | 2021-06-26,838 490 | 2021-06-27,782 491 | 2021-06-28,389 492 | 2021-06-29,679 493 | 2021-06-30,776 494 | 2021-07-01,882 495 | 2021-07-02,794 496 | 2021-07-03,932 497 | 2021-07-04,808 498 | 2021-07-05,480 499 | 2021-07-06,907 500 | 2021-07-07,1010 501 | 2021-07-08,1394 502 | -------------------------------------------------------------------------------- /experiments/FreqEstimator/Steel.csv: -------------------------------------------------------------------------------- 1 | Date,Close 2 | 03/27/23,1818.82 3 | 03/24/23,1798.15 4 | 03/23/23,1793.7 5 | 03/22/23,1792.86 6 | 03/21/23,1823.13 7 | 03/20/23,1793.32 8 | 03/17/23,1757.5 9 | 03/16/23,1791.6 10 | 03/15/23,1766.93 11 | 03/14/23,1889.84 12 | 03/13/23,1874.8 13 | 03/10/23,1900.49 14 | 03/09/23,1967.73 15 | 03/08/23,2036.38 16 | 03/07/23,2010.15 17 | 03/06/23,2051.34 18 | 03/03/23,2103.99 19 | 03/02/23,2071.19 20 | 03/01/23,2041.47 21 | 02/28/23,1980.48 22 | 02/27/23,1959.16 23 | 02/24/23,1934.49 24 | 02/23/23,1971.61 25 | 02/22/23,1976.52 26 | 02/21/23,1989.49 27 | 02/17/23,2015.7 28 | 02/16/23,2033.64 29 | 02/15/23,2018.28 30 | 02/14/23,2001.49 31 | 02/13/23,1972.33 32 | 02/10/23,1949.78 33 | 02/09/23,1948.47 34 | 02/08/23,1979.4 35 | 02/07/23,1990.08 36 | 02/06/23,1994.34 37 | 02/03/23,2034.61 38 | 02/02/23,2035.71 39 | 02/01/23,2060.79 40 | 01/31/23,2037.79 41 | 01/30/23,2014.34 42 | 01/27/23,2032.84 43 | 01/26/23,2058.22 44 | 01/25/23,1993.85 45 | 01/24/23,1966.3 46 | 01/23/23,1961.59 47 | 01/20/23,1961.43 48 | 01/19/23,1928.43 49 | 01/18/23,1933.58 50 | 01/17/23,1943.42 51 | 01/13/23,1964.12 52 | 01/12/23,1949.28 53 | 01/11/23,1909.36 54 | 01/10/23,1888.7 55 | 01/09/23,1823.56 56 | 01/06/23,1831.8 57 | 01/05/23,1768.45 58 | 01/04/23,1737.67 59 | 01/03/23,1707.69 60 | 12/30/22,1731.09 61 | 12/29/22,1742.91 62 | 12/28/22,1735.48 63 | 12/27/22,1768.63 64 | 12/23/22,1752.98 65 | 12/22/22,1748.82 66 | 12/21/22,1758.84 67 | 12/20/22,1720.3 68 | 12/19/22,1683.58 69 | 12/16/22,1696.47 70 | 12/15/22,1699.5 71 | 12/14/22,1752.36 72 | 12/13/22,1765.72 73 | 12/12/22,1757.04 74 | 12/09/22,1762.69 75 | 12/08/22,1781.0 76 | 12/07/22,1766.41 77 | 12/06/22,1790.55 78 | 12/05/22,1770.0 79 | 12/02/22,1809.69 80 | 12/01/22,1778.65 81 | 11/30/22,1787.37 82 | 11/29/22,1750.16 83 | 11/28/22,1702.69 84 | 11/25/22,1733.25 85 | 11/23/22,1730.67 86 | 11/22/22,1730.4 87 | 11/21/22,1700.81 88 | 11/18/22,1688.21 89 | 11/17/22,1698.71 90 | 11/16/22,1699.31 91 | 11/15/22,1729.77 92 | 11/14/22,1716.12 93 | 11/11/22,1700.39 94 | 11/10/22,1630.76 95 | 11/09/22,1583.59 96 | 11/08/22,1624.27 97 | 11/07/22,1600.95 98 | 11/04/22,1637.04 99 | 11/03/22,1519.22 100 | 11/02/22,1491.44 101 | 11/01/22,1566.0 102 | 10/31/22,1527.6 103 | 10/28/22,1515.46 104 | 10/27/22,1549.92 105 | 10/26/22,1569.01 106 | 10/25/22,1549.37 107 | 10/24/22,1545.64 108 | 10/21/22,1580.45 109 | 10/20/22,1500.53 110 | 10/19/22,1478.07 111 | 10/18/22,1498.03 112 | 10/17/22,1476.27 113 | 10/14/22,1437.51 114 | 10/13/22,1501.59 115 | 10/12/22,1464.68 116 | 10/11/22,1474.77 117 | 10/10/22,1484.97 118 | 10/07/22,1468.95 119 | 10/06/22,1486.24 120 | 10/05/22,1509.75 121 | 10/04/22,1518.65 122 | 10/03/22,1458.37 123 | 09/30/22,1372.03 124 | 09/29/22,1371.59 125 | 09/28/22,1395.9 126 | 09/27/22,1368.29 127 | 09/26/22,1343.26 128 | 09/23/22,1375.74 129 | 09/22/22,1439.03 130 | 09/21/22,1430.52 131 | 09/20/22,1458.59 132 | 09/19/22,1490.95 133 | 09/16/22,1449.24 134 | 09/15/22,1457.23 135 | 09/14/22,1466.5 136 | 09/13/22,1531.75 137 | 09/12/22,1598.49 138 | 09/09/22,1595.5 139 | 09/08/22,1519.28 140 | 09/07/22,1506.22 141 | 09/06/22,1493.14 142 | 09/02/22,1486.74 143 | 09/01/22,1479.72 144 | 08/31/22,1524.06 145 | 08/30/22,1548.73 146 | 08/29/22,1610.32 147 | 08/26/22,1613.25 148 | 08/25/22,1646.4 149 | 08/24/22,1597.03 150 | 08/23/22,1605.58 151 | 08/22/22,1550.85 152 | 08/19/22,1578.16 153 | 08/18/22,1619.96 154 | 08/17/22,1611.47 155 | 08/16/22,1646.71 156 | 08/15/22,1628.37 157 | 08/12/22,1653.55 158 | 08/11/22,1634.84 159 | 08/10/22,1631.17 160 | 08/09/22,1595.65 161 | 08/08/22,1573.62 162 | 08/05/22,1563.23 163 | 08/04/22,1533.14 164 | 08/03/22,1515.84 165 | 08/02/22,1532.48 166 | 08/01/22,1553.97 167 | 07/29/22,1569.48 168 | 07/28/22,1531.41 169 | 07/27/22,1510.9 170 | 07/26/22,1472.54 171 | 07/25/22,1476.71 172 | 07/22/22,1429.29 173 | 07/21/22,1463.31 174 | 07/20/22,1442.19 175 | 07/19/22,1445.08 176 | 07/18/22,1404.96 177 | 07/15/22,1384.88 178 | 07/14/22,1358.11 179 | 07/13/22,1417.9 180 | 07/12/22,1397.61 181 | 07/11/22,1398.97 182 | 07/08/22,1427.43 183 | 07/07/22,1437.24 184 | 07/06/22,1377.45 185 | 07/05/22,1384.2 186 | 07/01/22,1431.8 187 | 06/30/22,1441.03 188 | 06/29/22,1476.35 189 | 06/28/22,1497.29 190 | 06/27/22,1509.2 191 | 06/24/22,1494.77 192 | 06/23/22,1441.67 193 | 06/22/22,1475.37 194 | 06/21/22,1535.44 195 | 06/17/22,1533.2 196 | 06/16/22,1549.93 197 | 06/15/22,1623.49 198 | 06/14/22,1593.35 199 | 06/13/22,1606.41 200 | 06/10/22,1699.43 201 | 06/09/22,1741.4 202 | 06/08/22,1823.37 203 | 06/07/22,1900.84 204 | 06/06/22,1865.13 205 | 06/03/22,1848.83 206 | 06/02/22,1874.52 207 | 06/01/22,1830.34 208 | 05/31/22,1832.35 209 | 05/27/22,1873.94 210 | 05/26/22,1831.49 211 | 05/25/22,1783.33 212 | 05/24/22,1759.74 213 | 05/23/22,1763.91 214 | 05/20/22,1705.65 215 | 05/19/22,1687.92 216 | 05/18/22,1663.58 217 | 05/17/22,1727.7 218 | 05/16/22,1669.36 219 | 05/13/22,1652.33 220 | 05/12/22,1621.45 221 | 05/11/22,1639.16 222 | 05/10/22,1645.32 223 | 05/09/22,1658.19 224 | 05/06/22,1730.5 225 | 05/05/22,1757.13 226 | 05/04/22,1870.07 227 | 05/03/22,1836.86 228 | 05/02/22,1799.72 229 | 04/29/22,1824.25 230 | 04/28/22,1866.96 231 | 04/27/22,1828.06 232 | 04/26/22,1779.35 233 | 04/25/22,1837.95 234 | 04/22/22,1892.51 235 | 04/21/22,1968.22 236 | 04/20/22,2028.61 237 | 04/19/22,2055.11 238 | 04/18/22,2046.42 239 | 04/14/22,2039.58 240 | 04/13/22,2044.48 241 | 04/12/22,1992.92 242 | 04/11/22,1975.45 243 | 04/08/22,1976.89 244 | 04/07/22,1978.81 245 | 04/06/22,1962.46 246 | 04/05/22,1977.35 247 | 04/04/22,2024.17 248 | 04/01/22,2023.8 249 | 03/31/22,1986.85 250 | 03/30/22,1997.06 251 | 03/29/22,1988.15 252 | 03/28/22,2013.06 253 | 03/25/22,2043.19 254 | 03/24/22,2025.12 255 | 03/23/22,1973.42 256 | 03/22/22,1949.82 257 | 03/21/22,1961.14 258 | 03/18/22,1894.7 259 | 03/17/22,1881.01 260 | 03/16/22,1822.1 261 | 03/15/22,1774.47 262 | 03/14/22,1782.36 263 | 03/11/22,1842.49 264 | 03/10/22,1868.94 265 | 03/09/22,1830.73 266 | 03/08/22,1815.89 267 | 03/07/22,1867.29 268 | 03/04/22,1896.92 269 | 03/03/22,1907.94 270 | 03/02/22,1873.49 271 | 03/01/22,1797.75 272 | 02/28/22,1782.69 273 | 02/25/22,1754.9 274 | 02/24/22,1655.24 275 | 02/23/22,1667.19 276 | 02/22/22,1684.44 277 | 02/18/22,1687.24 278 | 02/17/22,1684.19 279 | 02/16/22,1729.9 280 | 02/15/22,1720.67 281 | 02/14/22,1701.14 282 | 02/11/22,1709.91 283 | 02/10/22,1739.29 284 | 02/09/22,1738.62 285 | 02/08/22,1708.86 286 | 02/07/22,1668.05 287 | 02/04/22,1640.58 288 | 02/03/22,1630.26 289 | 02/02/22,1649.32 290 | 02/01/22,1627.65 291 | 01/31/22,1554.14 292 | 01/28/22,1553.41 293 | 01/27/22,1548.37 294 | 01/26/22,1547.79 295 | 01/25/22,1551.11 296 | 01/24/22,1554.23 297 | 01/21/22,1557.41 298 | 01/20/22,1633.22 299 | 01/19/22,1675.27 300 | 01/18/22,1659.47 301 | 01/14/22,1690.97 302 | 01/13/22,1694.77 303 | 01/12/22,1713.27 304 | 01/11/22,1664.58 305 | 01/10/22,1638.34 306 | 01/07/22,1657.84 307 | 01/06/22,1624.79 308 | 01/05/22,1627.14 309 | 01/04/22,1603.73 310 | 01/03/22,1579.49 311 | 12/31/21,1580.2 312 | 12/30/21,1572.25 313 | 12/29/21,1567.14 314 | 12/28/21,1567.96 315 | 12/27/21,1581.27 316 | 12/23/21,1559.84 317 | 12/22/21,1561.22 318 | 12/21/21,1546.7 319 | 12/20/21,1510.98 320 | 12/17/21,1564.52 321 | 12/16/21,1566.54 322 | 12/15/21,1525.55 323 | 12/14/21,1547.36 324 | 12/13/21,1529.98 325 | 12/10/21,1531.27 326 | 12/09/21,1533.81 327 | 12/08/21,1546.36 328 | 12/07/21,1543.08 329 | 12/06/21,1501.65 330 | 12/03/21,1472.29 331 | 12/02/21,1489.35 332 | 12/01/21,1434.28 333 | 11/30/21,1441.54 334 | 11/29/21,1473.64 335 | 11/26/21,1491.31 336 | 11/24/21,1538.98 337 | 11/23/21,1555.19 338 | 11/22/21,1536.61 339 | 11/19/21,1490.06 340 | 11/18/21,1484.46 341 | 11/17/21,1495.78 342 | 11/16/21,1524.44 343 | 11/15/21,1537.88 344 | 11/12/21,1565.02 345 | 11/11/21,1576.9 346 | 11/10/21,1519.5 347 | 11/09/21,1556.89 348 | 11/08/21,1579.48 349 | 11/05/21,1539.54 350 | 11/04/21,1535.93 351 | 11/03/21,1542.86 352 | 11/02/21,1543.68 353 | 11/01/21,1571.28 354 | 10/29/21,1567.89 355 | 10/28/21,1570.57 356 | 10/27/21,1567.7 357 | 10/26/21,1618.85 358 | 10/25/21,1624.67 359 | 10/22/21,1569.8 360 | 10/21/21,1557.19 361 | 10/20/21,1600.69 362 | 10/19/21,1606.9 363 | 10/18/21,1616.12 364 | 10/15/21,1615.49 365 | 10/14/21,1604.26 366 | 10/13/21,1582.0 367 | 10/12/21,1581.28 368 | 10/11/21,1575.94 369 | 10/08/21,1551.94 370 | 10/07/21,1549.27 371 | 10/06/21,1520.67 372 | 10/05/21,1544.69 373 | 10/04/21,1533.63 374 | 10/01/21,1546.68 375 | 09/30/21,1535.67 376 | 09/29/21,1533.5 377 | 09/28/21,1542.96 378 | 09/27/21,1580.91 379 | 09/24/21,1554.23 380 | 09/23/21,1568.51 381 | 09/22/21,1567.97 382 | 09/21/21,1536.38 383 | 09/20/21,1542.09 384 | 09/17/21,1615.36 385 | 09/16/21,1681.81 386 | 09/15/21,1732.24 387 | 09/14/21,1689.47 388 | 09/13/21,1725.68 389 | 09/10/21,1722.98 390 | 09/09/21,1729.08 391 | 09/08/21,1726.91 392 | 09/07/21,1764.33 393 | 09/03/21,1767.89 394 | 09/02/21,1771.93 395 | 09/01/21,1772.35 396 | 08/31/21,1767.99 397 | 08/30/21,1795.88 398 | 08/27/21,1804.47 399 | 08/26/21,1753.29 400 | 08/25/21,1784.55 401 | 08/24/21,1789.86 402 | 08/23/21,1730.71 403 | 08/20/21,1709.09 404 | 08/19/21,1714.61 405 | 08/18/21,1790.02 406 | 08/17/21,1811.13 407 | 08/16/21,1868.58 408 | 08/13/21,1891.94 409 | 08/12/21,1894.08 410 | 08/11/21,1920.57 411 | 08/10/21,1898.95 412 | 08/09/21,1839.84 413 | 08/06/21,1825.39 414 | 08/05/21,1809.08 415 | 08/04/21,1839.64 416 | 08/03/21,1864.53 417 | 08/02/21,1828.65 418 | 07/30/21,1845.76 419 | 07/29/21,1885.15 420 | 07/28/21,1830.92 421 | 07/27/21,1792.27 422 | 07/26/21,1817.33 423 | 07/23/21,1759.99 424 | 07/22/21,1742.73 425 | 07/21/21,1747.01 426 | 07/20/21,1704.47 427 | 07/19/21,1672.98 428 | 07/16/21,1722.04 429 | 07/15/21,1778.0 430 | 07/14/21,1773.85 431 | 07/13/21,1774.22 432 | 07/12/21,1797.09 433 | 07/09/21,1784.16 434 | 07/08/21,1713.87 435 | 07/07/21,1751.51 436 | 07/06/21,1719.48 437 | 07/02/21,1771.06 438 | 07/01/21,1758.47 439 | 06/30/21,1766.28 440 | 06/29/21,1762.01 441 | 06/28/21,1750.09 442 | 06/25/21,1770.74 443 | 06/24/21,1780.84 444 | 06/23/21,1743.59 445 | 06/22/21,1730.56 446 | 06/21/21,1722.57 447 | 06/18/21,1678.96 448 | 06/17/21,1699.31 449 | 06/16/21,1766.03 450 | 06/15/21,1812.56 451 | 06/14/21,1827.9 452 | 06/11/21,1866.4 453 | 06/10/21,1839.43 454 | 06/09/21,1840.53 455 | 06/08/21,1838.4 456 | 06/07/21,1825.75 457 | 06/04/21,1855.1 458 | 06/03/21,1840.22 459 | 06/02/21,1859.37 460 | 06/01/21,1874.75 461 | 05/28/21,1809.11 462 | 05/27/21,1808.26 463 | 05/26/21,1759.48 464 | 05/25/21,1735.37 465 | 05/24/21,1777.4 466 | 05/21/21,1765.29 467 | 05/20/21,1785.83 468 | 05/19/21,1792.67 469 | 05/18/21,1853.25 470 | 05/17/21,1862.97 471 | 05/14/21,1825.25 472 | 05/13/21,1833.25 473 | 05/12/21,1835.93 474 | 05/11/21,1927.01 475 | 05/10/21,1895.48 476 | 05/07/21,1893.74 477 | 05/06/21,1854.66 478 | 05/05/21,1803.53 479 | 05/04/21,1772.92 480 | 05/03/21,1737.32 481 | 04/30/21,1701.78 482 | 04/29/21,1744.86 483 | 04/28/21,1753.49 484 | 04/27/21,1734.21 485 | 04/26/21,1738.36 486 | 04/23/21,1687.6 487 | 04/22/21,1647.17 488 | 04/21/21,1658.98 489 | 04/20/21,1628.09 490 | 04/19/21,1665.74 491 | 04/16/21,1667.62 492 | 04/15/21,1648.48 493 | 04/14/21,1639.6 494 | 04/13/21,1590.48 495 | 04/12/21,1591.39 496 | 04/09/21,1603.14 497 | 04/08/21,1619.6 498 | 04/07/21,1621.07 499 | 04/06/21,1615.61 500 | 04/05/21,1630.82 501 | 04/01/21,1593.3 502 | -------------------------------------------------------------------------------- /experiments/FreqEstimator/Test7.csv: -------------------------------------------------------------------------------- 1 | Data,Ultimo 2 | 2021-01-08,1.955 3 | 2021-01-15,1.902 4 | 2021-01-22,1.8842 5 | 2021-01-29,1.8052 6 | 2021-02-05,2.061 7 | 2021-02-12,2.096 8 | 2021-02-19,2.1085 9 | 2021-02-26,2.134 10 | 2021-03-05,2.1945 11 | 2021-03-12,2.2805 12 | 2021-03-19,2.314 13 | 2021-03-26,2.2975 14 | 2021-04-09,2.2535 15 | 2021-04-16,2.2955 16 | 2021-04-23,2.221 17 | 2021-04-30,2.321 18 | 2021-05-07,2.362 19 | 2021-05-14,2.3875 20 | 2021-05-21,2.374 21 | 2021-05-28,2.409 22 | 2021-06-04,2.4805 23 | 2021-06-11,2.425 24 | 2021-06-18,2.344 25 | 2021-06-25,2.3855 26 | 2021-07-02,2.336 27 | 2021-07-09,2.284 28 | 2021-07-16,2.232 29 | 2021-07-23,2.285 30 | 2021-07-30,2.3315 31 | 2021-08-06,2.3985 32 | 2021-08-13,2.448 33 | 2021-08-20,2.369 34 | 2021-08-27,2.378 35 | 2021-09-03,2.3875 36 | 2021-09-10,2.3465 37 | 2021-09-17,2.374 38 | 2021-09-24,2.4245 39 | 2021-10-01,2.449 40 | 2021-10-08,2.5175 41 | 2021-10-15,2.575 42 | 2021-10-22,2.4515 43 | 2021-10-29,2.4575 44 | 2021-11-05,2.4835 45 | 2021-11-12,2.4715 46 | 2021-11-19,2.384 47 | 2021-11-26,2.1565 48 | 2021-12-03,2.1465 49 | 2021-12-10,2.2155 50 | 2021-12-17,2.2055 51 | 2022-01-07,2.4515 52 | 2022-01-14,2.562 53 | 2022-01-21,2.552 54 | 2022-01-28,2.597 55 | 2022-02-04,2.667 56 | 2022-02-11,2.8535 57 | 2022-02-18,2.722 58 | 2022-02-25,2.4775 59 | 2022-03-04,1.8962 60 | 2022-03-11,1.9194 61 | 2022-03-18,2.086 62 | 2022-03-25,2.033 63 | 2022-04-01,2.105 64 | 2022-04-08,1.982 65 | 2022-04-22,1.9828 66 | 2022-04-29,1.9548 67 | 2022-05-06,1.88 68 | 2022-05-13,1.9724 69 | 2022-05-20,1.983 70 | 2022-05-27,2.047 71 | 2022-06-03,1.973 72 | 2022-06-10,1.8216 73 | 2022-06-17,1.8036 74 | 2022-06-24,1.8822 75 | 2022-07-01,1.7676 76 | 2022-07-08,1.7626 77 | 2022-07-15,1.632 78 | 2022-07-22,1.66 79 | 2022-07-29,1.7286 80 | 2022-08-05,1.814 81 | 2022-08-12,1.8538 82 | 2022-08-19,1.7732 83 | 2022-08-26,1.685 84 | 2022-09-02,1.7382 85 | 2022-09-09,1.8332 86 | 2022-09-16,1.915 87 | 2022-09-23,1.764 88 | 2022-09-30,1.7028 89 | 2022-10-07,1.7056 90 | 2022-10-14,1.7124 91 | 2022-10-21,1.8276 92 | 2022-10-28,1.9052 93 | 2022-11-04,2.065 94 | 2022-11-11,2.1605 95 | 2022-11-18,2.2165 96 | 2022-11-25,2.1585 97 | 2022-12-02,2.0965 98 | 2022-12-09,2.067 99 | 2022-12-16,2.058 100 | 2022-12-23,2.0925 101 | 2022-12-30,2.078 102 | 2023-01-06,2.2335 103 | 2023-01-13,2.288 104 | 2023-01-20,2.1805 105 | 2023-01-27,2.351 106 | 2023-02-03,2.383 107 | 2023-02-10,2.477 108 | 2023-02-17,2.5645 109 | 2023-02-24,2.495 110 | 2023-03-03,2.5745 111 | 2023-03-10,2.482 112 | 2023-03-17,2.193 113 | 2023-03-24,2.263 114 | 2023-03-31,2.3675 115 | 2023-04-14,2.4685 116 | 2023-04-21,2.4845 117 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "timexseries" 3 | version = "1.2.3" 4 | description = "TIMEX is a framework for time-series-forecasting-as-a-service." 5 | authors = ["Alessandro Falcetta ", "Manuel Roveri "] 6 | license = "Apache-2.0" 7 | 8 | readme = "README.md" 9 | 10 | repository = "https://github.com/AlexMV12/TIMEX" 11 | homepage = "https://alexmv12.github.io/TIMEX/" 12 | 13 | keywords = ["time-series", "time", "forecasting", "as-a-service"] 14 | 15 | classifiers = [ 16 | "Topic :: Scientific/Engineering :: Mathematics", 17 | "Topic :: Scientific/Engineering :: Information Analysis" 18 | ] 19 | 20 | 21 | [tool.poetry.dependencies] 22 | python = ">=3.8,<3.11" 23 | dateparser = "^1.1.0" 24 | gunicorn = "^20.1.0" 25 | pandas = "^1.5.0" 26 | joblib = "^1.2.0" 27 | holidays = "0.24" 28 | numpy = "1.23.5" 29 | 30 | scipy = { version = ">=1.10.1", optional = true} 31 | dash = { version = ">=2.0.0", optional = true} 32 | dash-bootstrap-components = { version = ">=1.0.3", optional = true} 33 | colorhash = { version = ">=1.0.4", optional = true} 34 | networkx = { version = ">=2.6.3", optional = true} 35 | statsforecast = { version = ">=1.0.0", optional = true} 36 | scikit-learn = { version = ">=1.2.1", optional = true} 37 | statsmodels = { version = ">=0.13.1", optional = true} 38 | prophet = { version = "1.1.1", optional = true} 39 | 40 | 41 | [tool.poetry.extras] 42 | data_prediction = ["prophet", "scipy", "statsmodels", "statsforecast", "scikit-learn"] 43 | data_visualization = ["dash", "dash-bootstrap-components", "colorhash", "networkx", "statsmodels"] 44 | 45 | 46 | [tool.poetry.group.dev.dependencies] 47 | pytest = "^6.2.2" 48 | pytest-cov = "^2.11.1" 49 | coverage-badge = "^1.0.1" 50 | pdoc3 = "^0.9.2" 51 | 52 | [build-system] 53 | requires = ["poetry-core"] 54 | build-backend = "poetry.core.masonry.api" 55 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DhiriaDev/TIMEX/767841a830bdc6fafbe1702700b9f80175e357de/tests/__init__.py -------------------------------------------------------------------------------- /tests/context.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) 4 | 5 | import timexseries -------------------------------------------------------------------------------- /tests/launch_tests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | rm .coverage 4 | coverage run --source=../timexseries/ -m pytest . 5 | coverage-badge -f -o ../badges/coverage.svg -------------------------------------------------------------------------------- /tests/test_data_visualization.py: -------------------------------------------------------------------------------- 1 | import pickle 2 | import pytest 3 | from timexseries.data_visualization import create_timeseries_dash_children 4 | 5 | from timexseries.data_prediction import create_timeseries_containers 6 | 7 | from timexseries.data_ingestion import ingest_timeseries 8 | 9 | # Testing data visualization is tricky. 10 | # Pre-computed Dash children are saved in a sample pkl file; these visualizations have been checked by a human. 11 | # Hence, a rudimental way to test data visualization is to check that the TIMEX code actually produces those plots, 12 | # by comparing the fresh created ones with the ones saved before. 13 | 14 | # Cant test cross-correlation graphs because they are random initialized. 15 | 16 | 17 | @pytest.fixture 18 | def dash_children(tmp_path): 19 | param_config = { 20 | "activity_title": "Example", 21 | "verbose": "INFO", 22 | "input_parameters": { 23 | "source_data_url": "test_datasets/data_visualization/test1.csv", 24 | "datetime_column_name": "ind", 25 | "index_column_name": "ind", 26 | "frequency": "D", 27 | }, 28 | "model_parameters": { 29 | "validation_values": 3, 30 | "delta_training_percentage": 30, 31 | "forecast_horizon": 5, 32 | "possible_transformations": "none,log_modified", 33 | "models": "mockup", 34 | "main_accuracy_estimator": "mae" 35 | }, 36 | "historical_prediction_parameters": { 37 | "initial_index": "2000-01-15", 38 | "save_path": f"{tmp_path}/historical_predictions.pkl" 39 | }, 40 | "visualization_parameters": { 41 | "xcorr_graph_threshold": 0.8, 42 | "box_plot_frequency": "1W" 43 | } 44 | } 45 | 46 | ingested_dataset = ingest_timeseries(param_config)[2] 47 | timeseries_containers = create_timeseries_containers(ingested_dataset, param_config) 48 | 49 | # Data visualization 50 | children_for_each_timeseries = [{ 51 | 'name': s.timeseries_data.columns[0], 52 | 'children': create_timeseries_dash_children(s, param_config) 53 | } for s in timeseries_containers] 54 | 55 | return children_for_each_timeseries 56 | 57 | 58 | @pytest.fixture 59 | def expected_children(): 60 | with open("test_datasets/data_visualization/expected_children1.pkl", "rb") as file: 61 | expected_children = pickle.load(file) 62 | 63 | return expected_children 64 | 65 | 66 | def test_1(dash_children, expected_children): 67 | for computed, expected in zip(dash_children[0]['children'], expected_children[0]['children']): 68 | assert computed.__str__() == expected.__str__() 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /tests/test_datasets/data_visualization/create_demo.py: -------------------------------------------------------------------------------- 1 | import pickle 2 | from datetime import datetime, timezone 3 | 4 | import dash 5 | from dash import html 6 | from datetime import datetime, timezone 7 | from dash import dcc 8 | import dateparser 9 | from dash.dependencies import Input, Output 10 | from pandas import read_csv 11 | 12 | from timexseries.data_ingestion import ingest_timeseries 13 | from timexseries.data_prediction import create_timeseries_containers 14 | from timexseries.data_visualization import create_timeseries_dash_children 15 | 16 | param_config = { 17 | "activity_title": "Example", 18 | "verbose": "INFO", 19 | "input_parameters": { 20 | "source_data_url": "test1.csv", 21 | "datetime_column_name": "ind", 22 | "index_column_name": "ind", 23 | "frequency": "D", 24 | }, 25 | "model_parameters": { 26 | "test_values": 3, 27 | "delta_training_percentage": 30, 28 | "prediction_lags": 5, 29 | "possible_transformations": "none,log_modified", 30 | "models": "mockup", 31 | "main_accuracy_estimator": "mae" 32 | }, 33 | "historical_prediction_parameters": { 34 | "initial_index": "2000-01-15", 35 | "save_path": f"historical_predictions.pkl" 36 | }, 37 | "visualization_parameters": { 38 | "xcorr_graph_threshold": 0.8, 39 | "box_plot_frequency": "1W" 40 | } 41 | } 42 | 43 | ingested_dataset = ingest_timeseries(param_config) 44 | timeseries_containers = create_timeseries_containers(ingested_dataset, param_config) 45 | 46 | # Data visualization 47 | children_for_each_timeseries = [{ 48 | 'name': s.timeseries_data.columns[0], 49 | 'children': create_timeseries_dash_children(s, param_config) 50 | } for s in timeseries_containers] 51 | 52 | with open("expected_children1.pkl", 'wb') as f: 53 | pickle.dump(children_for_each_timeseries, f) 54 | 55 | # Initialize Dash app. 56 | app = dash.Dash(__name__) 57 | server = app.server 58 | 59 | now = datetime.now(timezone.utc).strftime('%Y-%m-%d %H:%M:%S') 60 | 61 | disclaimer = [html.Div([ 62 | html.H1("Test"), 63 | html.Hr(), 64 | dcc.Markdown(''' 65 | Test 66 | '''), 67 | html.Div("Last updated at (yyyy-mm-dd, UTC time): " + str(now)), 68 | html.Br(), 69 | html.H2("Please select the data of interest:") 70 | ], style={'width': '80%', 'margin': 'auto'} 71 | ), dcc.Dropdown( 72 | id='timeseries_selector', 73 | options=[{'label': i['name'], 'value': i['name']} for i in children_for_each_timeseries], 74 | value='Time-series' 75 | ), html.Div(id="timeseries_wrapper"), html.Div(dcc.Graph(), style={'display': 'none'})] 76 | tree = html.Div(children=disclaimer, style={'width': '80%', 'margin': 'auto'}) 77 | 78 | app.layout = tree 79 | 80 | 81 | @app.callback( 82 | Output(component_id='timeseries_wrapper', component_property='children'), 83 | [Input(component_id='timeseries_selector', component_property='value')] 84 | ) 85 | def update_timeseries_wrapper(input_value): 86 | try: 87 | children = next(x['children'] for x in children_for_each_timeseries if x['name'] == input_value) 88 | except StopIteration: 89 | return html.Div(style={'padding': 200}) 90 | 91 | return children 92 | 93 | 94 | app.run_server() 95 | -------------------------------------------------------------------------------- /tests/test_datasets/data_visualization/expected_children1.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DhiriaDev/TIMEX/767841a830bdc6fafbe1702700b9f80175e357de/tests/test_datasets/data_visualization/expected_children1.pkl -------------------------------------------------------------------------------- /tests/test_datasets/data_visualization/test1.csv: -------------------------------------------------------------------------------- 1 | ind,A,B 2 | 2000-01-01,1,11 3 | 2000-01-02,2,12 4 | 2000-01-03,3,13 5 | 2000-01-04,4,14 6 | 2000-01-05,5,15 7 | 2000-01-06,6,16 8 | 2000-01-07,7,17 9 | 2000-01-08,8,18 10 | 2000-01-09,9,19 11 | 2000-01-10,10,20 12 | 2000-01-11,11,21 13 | 2000-01-12,12,22 14 | 2000-01-13,13,23 15 | 2000-01-14,14,24 16 | 2000-01-15,15,25 17 | 2000-01-16,16,26 18 | 2000-01-17,17,27 19 | 2000-01-18,18,28 20 | 2000-01-19,19,29 -------------------------------------------------------------------------------- /tests/test_datasets/infer_freq_datasets/_BrentOil.csv: -------------------------------------------------------------------------------- 1 | Date,Close/Last 2 | 04/11/2023,42 3 | 04/10/2023,42 4 | 04/06/2023,42 5 | 04/05/2023,42 6 | 04/04/2023,42 7 | 04/03/2023,42 8 | 03/31/2023,42 9 | 03/30/2023,42 10 | 03/29/2023,42 11 | 03/28/2023,42 12 | 03/27/2023,42 13 | 03/24/2023,42 14 | 03/23/2023,42 15 | 03/22/2023,42 16 | 03/21/2023,42 17 | 03/20/2023,42 18 | 03/17/2023,42 19 | 03/16/2023,42 20 | 03/15/2023,42 21 | 03/14/2023,42 22 | 03/13/2023,42 23 | 03/10/2023,42 24 | 03/09/2023,42 25 | 03/08/2023,42 26 | 03/07/2023,42 27 | 03/06/2023,42 28 | 03/03/2023,42 29 | 03/02/2023,42 30 | 03/01/2023,42 31 | 02/28/2023,42 32 | 02/27/2023,42 33 | 02/24/2023,42 34 | 02/23/2023,42 35 | 02/22/2023,42 36 | 02/21/2023,42 37 | 02/17/2023,42 38 | 02/16/2023,42 39 | 02/15/2023,42 40 | 02/14/2023,42 41 | 02/13/2023,42 42 | 02/10/2023,42 43 | 02/09/2023,42 44 | 02/08/2023,42 45 | 02/07/2023,42 46 | 02/06/2023,42 47 | 02/03/2023,42 48 | 02/02/2023,42 49 | 02/01/2023,42 50 | 01/31/2023,42 51 | 01/30/2023,42 52 | 01/27/2023,42 53 | 01/26/2023,42 54 | 01/25/2023,42 55 | 01/24/2023,42 56 | 01/23/2023,42 57 | 01/20/2023,42 58 | 01/19/2023,42 59 | 01/18/2023,42 60 | 01/17/2023,42 61 | 01/13/2023,42 62 | 01/12/2023,42 63 | 01/11/2023,42 64 | 01/10/2023,42 65 | 01/09/2023,42 66 | 01/06/2023,42 67 | 01/05/2023,42 68 | 01/04/2023,42 69 | 01/03/2023,42 70 | 12/30/2022,42 71 | 12/29/2022,42 72 | 12/28/2022,42 73 | 12/27/2022,42 74 | 12/23/2022,42 75 | 12/22/2022,42 76 | 12/21/2022,42 77 | 12/20/2022,42 78 | 12/19/2022,42 79 | 12/16/2022,42 80 | 12/15/2022,42 81 | 12/14/2022,42 82 | 12/13/2022,42 83 | 12/12/2022,42 84 | 12/09/2022,42 85 | 12/08/2022,42 86 | 12/07/2022,42 87 | 12/06/2022,42 88 | 12/05/2022,42 89 | 12/02/2022,42 90 | 12/01/2022,42 91 | 11/30/2022,42 92 | 11/29/2022,42 93 | 11/28/2022,42 94 | 11/25/2022,42 95 | 11/23/2022,42 96 | 11/22/2022,42 97 | 11/21/2022,42 98 | 11/18/2022,42 99 | 11/17/2022,42 100 | 11/16/2022,42 101 | 11/15/2022,42 102 | 11/14/2022,42 103 | 11/11/2022,42 104 | 11/10/2022,42 105 | 11/09/2022,42 106 | 11/08/2022,42 107 | 11/07/2022,42 108 | 11/04/2022,42 109 | 11/03/2022,42 110 | 11/02/2022,42 111 | 11/01/2022,42 112 | 10/31/2022,42 113 | 10/28/2022,42 114 | 10/27/2022,42 115 | 10/26/2022,42 116 | 10/25/2022,42 117 | 10/24/2022,42 118 | 10/21/2022,42 119 | 10/20/2022,42 120 | 10/19/2022,42 121 | 10/18/2022,42 122 | 10/17/2022,42 123 | 10/14/2022,42 124 | 10/13/2022,42 125 | 10/12/2022,42 126 | 10/11/2022,42 127 | 10/10/2022,42 128 | 10/07/2022,42 129 | 10/06/2022,42 130 | 10/05/2022,42 131 | 10/04/2022,42 132 | 10/03/2022,42 133 | 09/30/2022,42 134 | 09/29/2022,42 135 | 09/28/2022,42 136 | 09/27/2022,42 137 | 09/26/2022,42 138 | 09/23/2022,42 139 | 09/22/2022,42 140 | 09/21/2022,42 141 | 09/20/2022,42 142 | 09/19/2022,42 143 | 09/16/2022,42 144 | 09/15/2022,42 145 | 09/14/2022,42 146 | 09/13/2022,42 147 | 09/12/2022,42 148 | 09/09/2022,42 149 | 09/08/2022,42 150 | 09/07/2022,42 151 | 09/06/2022,42 152 | 09/02/2022,42 153 | 09/01/2022,42 154 | 08/31/2022,42 155 | 08/30/2022,42 156 | 08/29/2022,42 157 | 08/26/2022,42 158 | 08/25/2022,42 159 | 08/24/2022,42 160 | 08/23/2022,42 161 | 08/22/2022,42 162 | 08/19/2022,42 163 | 08/18/2022,42 164 | 08/17/2022,42 165 | 08/16/2022,42 166 | 08/15/2022,42 167 | 08/12/2022,42 168 | 08/11/2022,42 169 | 08/10/2022,42 170 | 08/09/2022,42 171 | 08/08/2022,42 172 | 08/05/2022,42 173 | 08/04/2022,42 174 | 08/03/2022,42 175 | 08/02/2022,42 176 | 08/01/2022,42 177 | 07/29/2022,42 178 | 07/28/2022,42 179 | 07/27/2022,42 180 | 07/26/2022,42 181 | 07/25/2022,42 182 | 07/22/2022,42 183 | 07/21/2022,42 184 | 07/20/2022,42 185 | 07/19/2022,42 186 | 07/18/2022,42 187 | 07/15/2022,42 188 | 07/14/2022,42 189 | 07/13/2022,42 190 | 07/12/2022,42 191 | 07/11/2022,42 192 | 07/08/2022,42 193 | 07/07/2022,42 194 | 07/06/2022,42 195 | 07/05/2022,42 196 | 07/01/2022,42 197 | 06/30/2022,42 198 | 06/29/2022,42 199 | 06/28/2022,42 200 | 06/27/2022,42 201 | 06/24/2022,42 202 | 06/23/2022,42 203 | 06/22/2022,42 204 | 06/21/2022,42 205 | 06/17/2022,42 206 | 06/16/2022,42 207 | 06/15/2022,42 208 | 06/14/2022,42 209 | 06/13/2022,42 210 | 06/10/2022,42 211 | 06/09/2022,42 212 | 06/08/2022,42 213 | 06/07/2022,42 214 | 06/06/2022,42 215 | 06/03/2022,42 216 | 06/02/2022,42 217 | 06/01/2022,42 218 | 05/31/2022,42 219 | 05/27/2022,42 220 | 05/26/2022,42 221 | 05/25/2022,42 222 | 05/24/2022,42 223 | 05/23/2022,42 224 | 05/20/2022,42 225 | 05/19/2022,42 226 | 05/18/2022,42 227 | 05/17/2022,42 228 | 05/16/2022,42 229 | 05/13/2022,42 230 | 05/12/2022,42 231 | 05/11/2022,42 232 | 05/10/2022,42 233 | 05/09/2022,42 234 | 05/06/2022,42 235 | 05/05/2022,42 236 | 05/04/2022,42 237 | 05/03/2022,42 238 | 05/02/2022,42 239 | 04/29/2022,42 240 | 04/28/2022,42 241 | 04/27/2022,42 242 | 04/26/2022,42 243 | 04/25/2022,42 244 | 04/22/2022,42 245 | 04/21/2022,42 246 | 04/20/2022,42 247 | 04/19/2022,42 248 | 04/18/2022,42 249 | 04/14/2022,42 250 | 04/13/2022,42 251 | 04/12/2022,42 252 | 04/11/2022,42 253 | 04/08/2022,42 254 | 04/07/2022,42 255 | 04/06/2022,42 256 | 04/05/2022,42 257 | 04/04/2022,42 258 | 04/01/2022,42 259 | 03/31/2022,42 260 | 03/30/2022,42 261 | 03/29/2022,42 262 | 03/28/2022,42 263 | 03/25/2022,42 264 | 03/24/2022,42 265 | 03/23/2022,42 266 | 03/22/2022,42 267 | 03/21/2022,42 268 | 03/18/2022,42 269 | 03/17/2022,42 270 | 03/16/2022,42 271 | 03/15/2022,42 272 | 03/14/2022,42 273 | 03/11/2022,42 274 | 03/10/2022,42 275 | 03/09/2022,42 276 | 03/08/2022,42 277 | 03/07/2022,42 278 | 03/04/2022,42 279 | 03/03/2022,42 280 | 03/02/2022,42 281 | 03/01/2022,42 282 | 02/28/2022,42 283 | 02/25/2022,42 284 | 02/24/2022,42 285 | 02/23/2022,42 286 | 02/22/2022,42 287 | 02/18/2022,42 288 | 02/17/2022,42 289 | 02/16/2022,42 290 | 02/15/2022,42 291 | 02/14/2022,42 292 | 02/11/2022,42 293 | 02/10/2022,42 294 | 02/09/2022,42 295 | 02/08/2022,42 296 | 02/07/2022,42 297 | 02/04/2022,42 298 | 02/03/2022,42 299 | 02/02/2022,42 300 | 02/01/2022,42 301 | 01/31/2022,42 302 | 01/28/2022,42 303 | 01/27/2022,42 304 | 01/26/2022,42 305 | 01/25/2022,42 306 | 01/24/2022,42 307 | 01/21/2022,42 308 | 01/20/2022,42 309 | 01/19/2022,42 310 | 01/18/2022,42 311 | 01/14/2022,42 312 | 01/13/2022,42 313 | 01/12/2022,42 314 | 01/11/2022,42 315 | 01/10/2022,42 316 | 01/07/2022,42 317 | 01/06/2022,42 318 | 01/05/2022,42 319 | 01/04/2022,42 320 | 01/03/2022,42 321 | 12/31/2021,42 322 | 12/30/2021,42 323 | 12/29/2021,42 324 | 12/28/2021,42 325 | 12/27/2021,42 326 | 12/23/2021,42 327 | 12/22/2021,42 328 | 12/21/2021,42 329 | 12/20/2021,42 330 | 12/17/2021,42 331 | 12/16/2021,42 332 | 12/15/2021,42 333 | 12/14/2021,42 334 | 12/13/2021,42 335 | 12/10/2021,42 336 | 12/09/2021,42 337 | 12/08/2021,42 338 | 12/07/2021,42 339 | 12/06/2021,42 340 | 12/03/2021,42 341 | 12/02/2021,42 342 | 12/01/2021,42 343 | 11/30/2021,42 344 | 11/29/2021,42 345 | 11/26/2021,42 346 | 11/24/2021,42 347 | 11/23/2021,42 348 | 11/22/2021,42 349 | 11/19/2021,42 350 | 11/18/2021,42 351 | 11/17/2021,42 352 | 11/16/2021,42 353 | 11/15/2021,42 354 | 11/12/2021,42 355 | 11/11/2021,42 356 | 11/10/2021,42 357 | 11/09/2021,42 358 | 11/08/2021,42 359 | 11/05/2021,42 360 | 11/04/2021,42 361 | 11/03/2021,42 362 | 11/02/2021,42 363 | 11/01/2021,42 364 | 10/29/2021,42 365 | 10/28/2021,42 366 | 10/27/2021,42 367 | 10/26/2021,42 368 | 10/25/2021,42 369 | 10/22/2021,42 370 | 10/21/2021,42 371 | 10/20/2021,42 372 | 10/19/2021,42 373 | 10/18/2021,42 374 | 10/15/2021,42 375 | 10/14/2021,42 376 | 10/13/2021,42 377 | 10/12/2021,42 378 | 10/11/2021,42 379 | 10/08/2021,42 380 | 10/07/2021,42 381 | 10/06/2021,42 382 | 10/05/2021,42 383 | 10/04/2021,42 384 | 10/01/2021,42 385 | 09/30/2021,42 386 | 09/29/2021,42 387 | 09/28/2021,42 388 | 09/27/2021,42 389 | 09/24/2021,42 390 | 09/23/2021,42 391 | 09/22/2021,42 392 | 09/21/2021,42 393 | 09/20/2021,42 394 | 09/17/2021,42 395 | 09/16/2021,42 396 | 09/15/2021,42 397 | 09/14/2021,42 398 | 09/13/2021,42 399 | 09/10/2021,42 400 | 09/09/2021,42 401 | 09/08/2021,42 402 | 09/07/2021,42 403 | 09/03/2021,42 404 | 09/02/2021,42 405 | 09/01/2021,42 406 | 08/31/2021,42 407 | 08/30/2021,42 408 | 08/27/2021,42 409 | 08/26/2021,42 410 | 08/25/2021,42 411 | 08/24/2021,42 412 | 08/23/2021,42 413 | 08/20/2021,42 414 | 08/19/2021,42 415 | 08/18/2021,42 416 | 08/17/2021,42 417 | 08/16/2021,42 418 | 08/13/2021,42 419 | 08/12/2021,42 420 | 08/11/2021,42 421 | 08/10/2021,42 422 | 08/09/2021,42 423 | 08/06/2021,42 424 | 08/05/2021,42 425 | 08/04/2021,42 426 | 08/03/2021,42 427 | 08/02/2021,42 428 | 07/30/2021,42 429 | 07/29/2021,42 430 | 07/28/2021,42 431 | 07/27/2021,42 432 | 07/26/2021,42 433 | 07/23/2021,42 434 | 07/22/2021,42 435 | 07/21/2021,42 436 | 07/20/2021,42 437 | 07/19/2021,42 438 | 07/16/2021,42 439 | 07/15/2021,42 440 | 07/14/2021,42 441 | 07/13/2021,42 442 | 07/12/2021,42 443 | 07/09/2021,42 444 | 07/08/2021,42 445 | 07/07/2021,42 446 | 07/06/2021,42 447 | 07/02/2021,42 448 | 07/01/2021,42 449 | 06/30/2021,42 450 | 06/29/2021,42 451 | 06/28/2021,42 452 | 06/25/2021,42 453 | 06/24/2021,42 454 | 06/23/2021,42 455 | 06/22/2021,42 456 | 06/21/2021,42 457 | 06/18/2021,42 458 | 06/17/2021,42 459 | 06/16/2021,42 460 | 06/15/2021,42 461 | 06/14/2021,42 462 | 06/11/2021,42 463 | 06/10/2021,42 464 | 06/09/2021,42 465 | 06/08/2021,42 466 | 06/07/2021,42 467 | 06/04/2021,42 468 | 06/03/2021,42 469 | 06/02/2021,42 470 | 06/01/2021,42 471 | 05/28/2021,42 472 | 05/27/2021,42 473 | 05/26/2021,42 474 | 05/25/2021,42 475 | 05/24/2021,42 476 | 05/21/2021,42 477 | 05/20/2021,42 478 | 05/19/2021,42 479 | 05/18/2021,42 480 | 05/17/2021,42 481 | 05/14/2021,42 482 | 05/13/2021,42 483 | 05/12/2021,42 484 | 05/11/2021,42 485 | 05/10/2021,42 486 | 05/07/2021,42 487 | 05/06/2021,42 488 | 05/05/2021,42 489 | 05/04/2021,42 490 | 05/03/2021,42 491 | 04/30/2021,42 492 | 04/29/2021,42 493 | 04/28/2021,42 494 | 04/27/2021,42 495 | 04/26/2021,42 496 | 04/23/2021,42 497 | 04/22/2021,42 498 | 04/21/2021,42 499 | 04/20/2021,42 500 | 04/19/2021,42 501 | 04/16/2021,42 502 | -------------------------------------------------------------------------------- /tests/test_datasets/infer_freq_datasets/_Steel.csv: -------------------------------------------------------------------------------- 1 | Date,Close 2 | 03/27/23,42 3 | 03/24/23,42 4 | 03/23/23,42 5 | 03/22/23,42 6 | 03/21/23,42 7 | 03/20/23,42 8 | 03/17/23,42 9 | 03/16/23,42 10 | 03/15/23,42 11 | 03/14/23,42 12 | 03/13/23,42 13 | 03/10/23,42 14 | 03/09/23,42 15 | 03/08/23,42 16 | 03/07/23,42 17 | 03/06/23,42 18 | 03/03/23,42 19 | 03/02/23,42 20 | 03/01/23,42 21 | 02/28/23,42 22 | 02/27/23,42 23 | 02/24/23,42 24 | 02/23/23,42 25 | 02/22/23,42 26 | 02/21/23,42 27 | 02/17/23,42 28 | 02/16/23,42 29 | 02/15/23,42 30 | 02/14/23,42 31 | 02/13/23,42 32 | 02/10/23,42 33 | 02/09/23,42 34 | 02/08/23,42 35 | 02/07/23,42 36 | 02/06/23,42 37 | 02/03/23,42 38 | 02/02/23,42 39 | 02/01/23,42 40 | 01/31/23,42 41 | 01/30/23,42 42 | 01/27/23,42 43 | 01/26/23,42 44 | 01/25/23,42 45 | 01/24/23,42 46 | 01/23/23,42 47 | 01/20/23,42 48 | 01/19/23,42 49 | 01/18/23,42 50 | 01/17/23,42 51 | 01/13/23,42 52 | 01/12/23,42 53 | 01/11/23,42 54 | 01/10/23,42 55 | 01/09/23,42 56 | 01/06/23,42 57 | 01/05/23,42 58 | 01/04/23,42 59 | 01/03/23,42 60 | 12/30/22,42 61 | 12/29/22,42 62 | 12/28/22,42 63 | 12/27/22,42 64 | 12/23/22,42 65 | 12/22/22,42 66 | 12/21/22,42 67 | 12/20/22,42 68 | 12/19/22,42 69 | 12/16/22,42 70 | 12/15/22,42 71 | 12/14/22,42 72 | 12/13/22,42 73 | 12/12/22,42 74 | 12/09/22,42 75 | 12/08/22,42 76 | 12/07/22,42 77 | 12/06/22,42 78 | 12/05/22,42 79 | 12/02/22,42 80 | 12/01/22,42 81 | 11/30/22,42 82 | 11/29/22,42 83 | 11/28/22,42 84 | 11/25/22,42 85 | 11/23/22,42 86 | 11/22/22,42 87 | 11/21/22,42 88 | 11/18/22,42 89 | 11/17/22,42 90 | 11/16/22,42 91 | 11/15/22,42 92 | 11/14/22,42 93 | 11/11/22,42 94 | 11/10/22,42 95 | 11/09/22,42 96 | 11/08/22,42 97 | 11/07/22,42 98 | 11/04/22,42 99 | 11/03/22,42 100 | 11/02/22,42 101 | 11/01/22,42 102 | 10/31/22,42 103 | 10/28/22,42 104 | 10/27/22,42 105 | 10/26/22,42 106 | 10/25/22,42 107 | 10/24/22,42 108 | 10/21/22,42 109 | 10/20/22,42 110 | 10/19/22,42 111 | 10/18/22,42 112 | 10/17/22,42 113 | 10/14/22,42 114 | 10/13/22,42 115 | 10/12/22,42 116 | 10/11/22,42 117 | 10/10/22,42 118 | 10/07/22,42 119 | 10/06/22,42 120 | 10/05/22,42 121 | 10/04/22,42 122 | 10/03/22,42 123 | 09/30/22,42 124 | 09/29/22,42 125 | 09/28/22,42 126 | 09/27/22,42 127 | 09/26/22,42 128 | 09/23/22,42 129 | 09/22/22,42 130 | 09/21/22,42 131 | 09/20/22,42 132 | 09/19/22,42 133 | 09/16/22,42 134 | 09/15/22,42 135 | 09/14/22,42 136 | 09/13/22,42 137 | 09/12/22,42 138 | 09/09/22,42 139 | 09/08/22,42 140 | 09/07/22,42 141 | 09/06/22,42 142 | 09/02/22,42 143 | 09/01/22,42 144 | 08/31/22,42 145 | 08/30/22,42 146 | 08/29/22,42 147 | 08/26/22,42 148 | 08/25/22,42 149 | 08/24/22,42 150 | 08/23/22,42 151 | 08/22/22,42 152 | 08/19/22,42 153 | 08/18/22,42 154 | 08/17/22,42 155 | 08/16/22,42 156 | 08/15/22,42 157 | 08/12/22,42 158 | 08/11/22,42 159 | 08/10/22,42 160 | 08/09/22,42 161 | 08/08/22,42 162 | 08/05/22,42 163 | 08/04/22,42 164 | 08/03/22,42 165 | 08/02/22,42 166 | 08/01/22,42 167 | 07/29/22,42 168 | 07/28/22,42 169 | 07/27/22,42 170 | 07/26/22,42 171 | 07/25/22,42 172 | 07/22/22,42 173 | 07/21/22,42 174 | 07/20/22,42 175 | 07/19/22,42 176 | 07/18/22,42 177 | 07/15/22,42 178 | 07/14/22,42 179 | 07/13/22,42 180 | 07/12/22,42 181 | 07/11/22,42 182 | 07/08/22,42 183 | 07/07/22,42 184 | 07/06/22,42 185 | 07/05/22,42 186 | 07/01/22,42 187 | 06/30/22,42 188 | 06/29/22,42 189 | 06/28/22,42 190 | 06/27/22,42 191 | 06/24/22,42 192 | 06/23/22,42 193 | 06/22/22,42 194 | 06/21/22,42 195 | 06/17/22,42 196 | 06/16/22,42 197 | 06/15/22,42 198 | 06/14/22,42 199 | 06/13/22,42 200 | 06/10/22,42 201 | 06/09/22,42 202 | 06/08/22,42 203 | 06/07/22,42 204 | 06/06/22,42 205 | 06/03/22,42 206 | 06/02/22,42 207 | 06/01/22,42 208 | 05/31/22,42 209 | 05/27/22,42 210 | 05/26/22,42 211 | 05/25/22,42 212 | 05/24/22,42 213 | 05/23/22,42 214 | 05/20/22,42 215 | 05/19/22,42 216 | 05/18/22,42 217 | 05/17/22,42 218 | 05/16/22,42 219 | 05/13/22,42 220 | 05/12/22,42 221 | 05/11/22,42 222 | 05/10/22,42 223 | 05/09/22,42 224 | 05/06/22,42 225 | 05/05/22,42 226 | 05/04/22,42 227 | 05/03/22,42 228 | 05/02/22,42 229 | 04/29/22,42 230 | 04/28/22,42 231 | 04/27/22,42 232 | 04/26/22,42 233 | 04/25/22,42 234 | 04/22/22,42 235 | 04/21/22,42 236 | 04/20/22,42 237 | 04/19/22,42 238 | 04/18/22,42 239 | 04/14/22,42 240 | 04/13/22,42 241 | 04/12/22,42 242 | 04/11/22,42 243 | 04/08/22,42 244 | 04/07/22,42 245 | 04/06/22,42 246 | 04/05/22,42 247 | 04/04/22,42 248 | 04/01/22,42 249 | 03/31/22,42 250 | 03/30/22,42 251 | 03/29/22,42 252 | 03/28/22,42 253 | 03/25/22,42 254 | 03/24/22,42 255 | 03/23/22,42 256 | 03/22/22,42 257 | 03/21/22,42 258 | 03/18/22,42 259 | 03/17/22,42 260 | 03/16/22,42 261 | 03/15/22,42 262 | 03/14/22,42 263 | 03/11/22,42 264 | 03/10/22,42 265 | 03/09/22,42 266 | 03/08/22,42 267 | 03/07/22,42 268 | 03/04/22,42 269 | 03/03/22,42 270 | 03/02/22,42 271 | 03/01/22,42 272 | 02/28/22,42 273 | 02/25/22,42 274 | 02/24/22,42 275 | 02/23/22,42 276 | 02/22/22,42 277 | 02/18/22,42 278 | 02/17/22,42 279 | 02/16/22,42 280 | 02/15/22,42 281 | 02/14/22,42 282 | 02/11/22,42 283 | 02/10/22,42 284 | 02/09/22,42 285 | 02/08/22,42 286 | 02/07/22,42 287 | 02/04/22,42 288 | 02/03/22,42 289 | 02/02/22,42 290 | 02/01/22,42 291 | 01/31/22,42 292 | 01/28/22,42 293 | 01/27/22,42 294 | 01/26/22,42 295 | 01/25/22,42 296 | 01/24/22,42 297 | 01/21/22,42 298 | 01/20/22,42 299 | 01/19/22,42 300 | 01/18/22,42 301 | 01/14/22,42 302 | 01/13/22,42 303 | 01/12/22,42 304 | 01/11/22,42 305 | 01/10/22,42 306 | 01/07/22,42 307 | 01/06/22,42 308 | 01/05/22,42 309 | 01/04/22,42 310 | 01/03/22,42 311 | 12/31/21,42 312 | 12/30/21,42 313 | 12/29/21,42 314 | 12/28/21,42 315 | 12/27/21,42 316 | 12/23/21,42 317 | 12/22/21,42 318 | 12/21/21,42 319 | 12/20/21,42 320 | 12/17/21,42 321 | 12/16/21,42 322 | 12/15/21,42 323 | 12/14/21,42 324 | 12/13/21,42 325 | 12/10/21,42 326 | 12/09/21,42 327 | 12/08/21,42 328 | 12/07/21,42 329 | 12/06/21,42 330 | 12/03/21,42 331 | 12/02/21,42 332 | 12/01/21,42 333 | 11/30/21,42 334 | 11/29/21,42 335 | 11/26/21,42 336 | 11/24/21,42 337 | 11/23/21,42 338 | 11/22/21,42 339 | 11/19/21,42 340 | 11/18/21,42 341 | 11/17/21,42 342 | 11/16/21,42 343 | 11/15/21,42 344 | 11/12/21,42 345 | 11/11/21,42 346 | 11/10/21,42 347 | 11/09/21,42 348 | 11/08/21,42 349 | 11/05/21,42 350 | 11/04/21,42 351 | 11/03/21,42 352 | 11/02/21,42 353 | 11/01/21,42 354 | 10/29/21,42 355 | 10/28/21,42 356 | 10/27/21,42 357 | 10/26/21,42 358 | 10/25/21,42 359 | 10/22/21,42 360 | 10/21/21,42 361 | 10/20/21,42 362 | 10/19/21,42 363 | 10/18/21,42 364 | 10/15/21,42 365 | 10/14/21,42 366 | 10/13/21,42 367 | 10/12/21,42 368 | 10/11/21,42 369 | 10/08/21,42 370 | 10/07/21,42 371 | 10/06/21,42 372 | 10/05/21,42 373 | 10/04/21,42 374 | 10/01/21,42 375 | 09/30/21,42 376 | 09/29/21,42 377 | 09/28/21,42 378 | 09/27/21,42 379 | 09/24/21,42 380 | 09/23/21,42 381 | 09/22/21,42 382 | 09/21/21,42 383 | 09/20/21,42 384 | 09/17/21,42 385 | 09/16/21,42 386 | 09/15/21,42 387 | 09/14/21,42 388 | 09/13/21,42 389 | 09/10/21,42 390 | 09/09/21,42 391 | 09/08/21,42 392 | 09/07/21,42 393 | 09/03/21,42 394 | 09/02/21,42 395 | 09/01/21,42 396 | 08/31/21,42 397 | 08/30/21,42 398 | 08/27/21,42 399 | 08/26/21,42 400 | 08/25/21,42 401 | 08/24/21,42 402 | 08/23/21,42 403 | 08/20/21,42 404 | 08/19/21,42 405 | 08/18/21,42 406 | 08/17/21,42 407 | 08/16/21,42 408 | 08/13/21,42 409 | 08/12/21,42 410 | 08/11/21,42 411 | 08/10/21,42 412 | 08/09/21,42 413 | 08/06/21,42 414 | 08/05/21,42 415 | 08/04/21,42 416 | 08/03/21,42 417 | 08/02/21,42 418 | 07/30/21,42 419 | 07/29/21,42 420 | 07/28/21,42 421 | 07/27/21,42 422 | 07/26/21,42 423 | 07/23/21,42 424 | 07/22/21,42 425 | 07/21/21,42 426 | 07/20/21,42 427 | 07/19/21,42 428 | 07/16/21,42 429 | 07/15/21,42 430 | 07/14/21,42 431 | 07/13/21,42 432 | 07/12/21,42 433 | 07/09/21,42 434 | 07/08/21,42 435 | 07/07/21,42 436 | 07/06/21,42 437 | 07/02/21,42 438 | 07/01/21,42 439 | 06/30/21,42 440 | 06/29/21,42 441 | 06/28/21,42 442 | 06/25/21,42 443 | 06/24/21,42 444 | 06/23/21,42 445 | 06/22/21,42 446 | 06/21/21,42 447 | 06/18/21,42 448 | 06/17/21,42 449 | 06/16/21,42 450 | 06/15/21,42 451 | 06/14/21,42 452 | 06/11/21,42 453 | 06/10/21,42 454 | 06/09/21,42 455 | 06/08/21,42 456 | 06/07/21,42 457 | 06/04/21,42 458 | 06/03/21,42 459 | 06/02/21,42 460 | 06/01/21,42 461 | 05/28/21,42 462 | 05/27/21,42 463 | 05/26/21,42 464 | 05/25/21,42 465 | 05/24/21,42 466 | 05/21/21,42 467 | 05/20/21,42 468 | 05/19/21,42 469 | 05/18/21,42 470 | 05/17/21,42 471 | 05/14/21,42 472 | 05/13/21,42 473 | 05/12/21,42 474 | 05/11/21,42 475 | 05/10/21,42 476 | 05/07/21,42 477 | 05/06/21,42 478 | 05/05/21,42 479 | 05/04/21,42 480 | 05/03/21,42 481 | 04/30/21,42 482 | 04/29/21,42 483 | 04/28/21,42 484 | 04/27/21,42 485 | 04/26/21,42 486 | 04/23/21,42 487 | 04/22/21,42 488 | 04/21/21,42 489 | 04/20/21,42 490 | 04/19/21,42 491 | 04/16/21,42 492 | 04/15/21,42 493 | 04/14/21,42 494 | 04/13/21,42 495 | 04/12/21,42 496 | 04/09/21,42 497 | 04/08/21,42 498 | 04/07/21,42 499 | 04/06/21,42 500 | 04/05/21,42 501 | 04/01/21,42 502 | -------------------------------------------------------------------------------- /tests/test_datasets/infer_freq_datasets/_Covid.csv: -------------------------------------------------------------------------------- 1 | Data,Nuovi casi 2 | 2020-02-25,42 3 | 2020-02-26,42 4 | 2020-02-27,42 5 | 2020-02-28,42 6 | 2020-02-29,42 7 | 2020-03-01,42 8 | 2020-03-02,42 9 | 2020-03-03,42 10 | 2020-03-04,42 11 | 2020-03-05,42 12 | 2020-03-06,42 13 | 2020-03-07,42 14 | 2020-03-08,42 15 | 2020-03-09,42 16 | 2020-03-10,42 17 | 2020-03-11,42 18 | 2020-03-12,42 19 | 2020-03-13,42 20 | 2020-03-14,42 21 | 2020-03-15,42 22 | 2020-03-16,42 23 | 2020-03-17,42 24 | 2020-03-18,42 25 | 2020-03-19,42 26 | 2020-03-20,42 27 | 2020-03-21,42 28 | 2020-03-22,42 29 | 2020-03-23,42 30 | 2020-03-24,42 31 | 2020-03-25,42 32 | 2020-03-26,42 33 | 2020-03-27,42 34 | 2020-03-28,42 35 | 2020-03-29,42 36 | 2020-03-30,42 37 | 2020-03-31,42 38 | 2020-04-01,42 39 | 2020-04-02,42 40 | 2020-04-03,42 41 | 2020-04-04,42 42 | 2020-04-05,42 43 | 2020-04-06,42 44 | 2020-04-07,42 45 | 2020-04-08,42 46 | 2020-04-09,42 47 | 2020-04-10,42 48 | 2020-04-11,42 49 | 2020-04-12,42 50 | 2020-04-13,42 51 | 2020-04-14,42 52 | 2020-04-15,42 53 | 2020-04-16,42 54 | 2020-04-17,42 55 | 2020-04-18,42 56 | 2020-04-19,42 57 | 2020-04-20,42 58 | 2020-04-21,42 59 | 2020-04-22,42 60 | 2020-04-23,42 61 | 2020-04-24,42 62 | 2020-04-25,42 63 | 2020-04-26,42 64 | 2020-04-27,42 65 | 2020-04-28,42 66 | 2020-04-29,42 67 | 2020-04-30,42 68 | 2020-05-01,42 69 | 2020-05-02,42 70 | 2020-05-03,42 71 | 2020-05-04,42 72 | 2020-05-05,42 73 | 2020-05-06,42 74 | 2020-05-07,42 75 | 2020-05-08,42 76 | 2020-05-09,42 77 | 2020-05-10,42 78 | 2020-05-11,42 79 | 2020-05-12,42 80 | 2020-05-13,42 81 | 2020-05-14,42 82 | 2020-05-15,42 83 | 2020-05-16,42 84 | 2020-05-17,42 85 | 2020-05-18,42 86 | 2020-05-19,42 87 | 2020-05-20,42 88 | 2020-05-21,42 89 | 2020-05-22,42 90 | 2020-05-23,42 91 | 2020-05-24,42 92 | 2020-05-25,42 93 | 2020-05-26,42 94 | 2020-05-27,42 95 | 2020-05-28,42 96 | 2020-05-29,42 97 | 2020-05-30,42 98 | 2020-05-31,42 99 | 2020-06-01,42 100 | 2020-06-02,42 101 | 2020-06-03,42 102 | 2020-06-04,42 103 | 2020-06-05,42 104 | 2020-06-06,42 105 | 2020-06-07,42 106 | 2020-06-08,42 107 | 2020-06-09,42 108 | 2020-06-10,42 109 | 2020-06-11,42 110 | 2020-06-12,42 111 | 2020-06-13,42 112 | 2020-06-14,42 113 | 2020-06-15,42 114 | 2020-06-16,42 115 | 2020-06-17,42 116 | 2020-06-18,42 117 | 2020-06-19,42 118 | 2020-06-20,42 119 | 2020-06-21,42 120 | 2020-06-22,42 121 | 2020-06-23,42 122 | 2020-06-24,42 123 | 2020-06-25,42 124 | 2020-06-26,42 125 | 2020-06-27,42 126 | 2020-06-28,42 127 | 2020-06-29,42 128 | 2020-06-30,42 129 | 2020-07-01,42 130 | 2020-07-02,42 131 | 2020-07-03,42 132 | 2020-07-04,42 133 | 2020-07-05,42 134 | 2020-07-06,42 135 | 2020-07-07,42 136 | 2020-07-08,42 137 | 2020-07-09,42 138 | 2020-07-10,42 139 | 2020-07-11,42 140 | 2020-07-12,42 141 | 2020-07-13,42 142 | 2020-07-14,42 143 | 2020-07-15,42 144 | 2020-07-16,42 145 | 2020-07-17,42 146 | 2020-07-18,42 147 | 2020-07-19,42 148 | 2020-07-20,42 149 | 2020-07-21,42 150 | 2020-07-22,42 151 | 2020-07-23,42 152 | 2020-07-24,42 153 | 2020-07-25,42 154 | 2020-07-26,42 155 | 2020-07-27,42 156 | 2020-07-28,42 157 | 2020-07-29,42 158 | 2020-07-30,42 159 | 2020-07-31,42 160 | 2020-08-01,42 161 | 2020-08-02,42 162 | 2020-08-03,42 163 | 2020-08-04,42 164 | 2020-08-05,42 165 | 2020-08-06,42 166 | 2020-08-07,42 167 | 2020-08-08,42 168 | 2020-08-09,42 169 | 2020-08-10,42 170 | 2020-08-11,42 171 | 2020-08-12,42 172 | 2020-08-13,42 173 | 2020-08-14,42 174 | 2020-08-15,42 175 | 2020-08-16,42 176 | 2020-08-17,42 177 | 2020-08-18,42 178 | 2020-08-19,42 179 | 2020-08-20,42 180 | 2020-08-21,42 181 | 2020-08-22,42 182 | 2020-08-23,42 183 | 2020-08-24,42 184 | 2020-08-25,42 185 | 2020-08-26,42 186 | 2020-08-27,42 187 | 2020-08-28,42 188 | 2020-08-29,42 189 | 2020-08-30,42 190 | 2020-08-31,42 191 | 2020-09-01,42 192 | 2020-09-02,42 193 | 2020-09-03,42 194 | 2020-09-04,42 195 | 2020-09-05,42 196 | 2020-09-06,42 197 | 2020-09-07,42 198 | 2020-09-08,42 199 | 2020-09-09,42 200 | 2020-09-10,42 201 | 2020-09-11,42 202 | 2020-09-12,42 203 | 2020-09-13,42 204 | 2020-09-14,42 205 | 2020-09-15,42 206 | 2020-09-16,42 207 | 2020-09-17,42 208 | 2020-09-18,42 209 | 2020-09-19,42 210 | 2020-09-20,42 211 | 2020-09-21,42 212 | 2020-09-22,42 213 | 2020-09-23,42 214 | 2020-09-24,42 215 | 2020-09-25,42 216 | 2020-09-26,42 217 | 2020-09-27,42 218 | 2020-09-28,42 219 | 2020-09-29,42 220 | 2020-09-30,42 221 | 2020-10-01,42 222 | 2020-10-02,42 223 | 2020-10-03,42 224 | 2020-10-04,42 225 | 2020-10-05,42 226 | 2020-10-06,42 227 | 2020-10-07,42 228 | 2020-10-08,42 229 | 2020-10-09,42 230 | 2020-10-10,42 231 | 2020-10-11,42 232 | 2020-10-12,42 233 | 2020-10-13,42 234 | 2020-10-14,42 235 | 2020-10-15,42 236 | 2020-10-16,42 237 | 2020-10-17,42 238 | 2020-10-18,42 239 | 2020-10-19,42 240 | 2020-10-20,42 241 | 2020-10-21,42 242 | 2020-10-22,42 243 | 2020-10-23,42 244 | 2020-10-24,42 245 | 2020-10-25,42 246 | 2020-10-26,42 247 | 2020-10-27,42 248 | 2020-10-28,42 249 | 2020-10-29,42 250 | 2020-10-30,42 251 | 2020-10-31,42 252 | 2020-11-01,42 253 | 2020-11-02,42 254 | 2020-11-03,42 255 | 2020-11-04,42 256 | 2020-11-05,42 257 | 2020-11-06,42 258 | 2020-11-07,42 259 | 2020-11-08,42 260 | 2020-11-09,42 261 | 2020-11-10,42 262 | 2020-11-11,42 263 | 2020-11-12,42 264 | 2020-11-13,42 265 | 2020-11-14,42 266 | 2020-11-15,42 267 | 2020-11-16,42 268 | 2020-11-17,42 269 | 2020-11-18,42 270 | 2020-11-19,42 271 | 2020-11-20,42 272 | 2020-11-21,42 273 | 2020-11-22,42 274 | 2020-11-23,42 275 | 2020-11-24,42 276 | 2020-11-25,42 277 | 2020-11-26,42 278 | 2020-11-27,42 279 | 2020-11-28,42 280 | 2020-11-29,42 281 | 2020-11-30,42 282 | 2020-12-01,42 283 | 2020-12-02,42 284 | 2020-12-03,42 285 | 2020-12-04,42 286 | 2020-12-05,42 287 | 2020-12-06,42 288 | 2020-12-07,42 289 | 2020-12-08,42 290 | 2020-12-09,42 291 | 2020-12-10,42 292 | 2020-12-11,42 293 | 2020-12-12,42 294 | 2020-12-13,42 295 | 2020-12-14,42 296 | 2020-12-15,42 297 | 2020-12-16,42 298 | 2020-12-17,42 299 | 2020-12-18,42 300 | 2020-12-19,42 301 | 2020-12-20,42 302 | 2020-12-21,42 303 | 2020-12-22,42 304 | 2020-12-23,42 305 | 2020-12-24,42 306 | 2020-12-25,42 307 | 2020-12-26,42 308 | 2020-12-27,42 309 | 2020-12-28,42 310 | 2020-12-29,42 311 | 2020-12-30,42 312 | 2020-12-31,42 313 | 2021-01-01,42 314 | 2021-01-02,42 315 | 2021-01-03,42 316 | 2021-01-04,42 317 | 2021-01-05,42 318 | 2021-01-06,42 319 | 2021-01-07,42 320 | 2021-01-08,42 321 | 2021-01-09,42 322 | 2021-01-10,42 323 | 2021-01-11,42 324 | 2021-01-12,42 325 | 2021-01-13,42 326 | 2021-01-14,42 327 | 2021-01-15,42 328 | 2021-01-16,42 329 | 2021-01-17,42 330 | 2021-01-18,42 331 | 2021-01-19,42 332 | 2021-01-20,42 333 | 2021-01-21,42 334 | 2021-01-22,42 335 | 2021-01-23,42 336 | 2021-01-24,42 337 | 2021-01-25,42 338 | 2021-01-26,42 339 | 2021-01-27,42 340 | 2021-01-28,42 341 | 2021-01-29,42 342 | 2021-01-30,42 343 | 2021-01-31,42 344 | 2021-02-01,42 345 | 2021-02-02,42 346 | 2021-02-03,42 347 | 2021-02-04,42 348 | 2021-02-05,42 349 | 2021-02-06,42 350 | 2021-02-07,42 351 | 2021-02-08,42 352 | 2021-02-09,42 353 | 2021-02-10,42 354 | 2021-02-11,42 355 | 2021-02-12,42 356 | 2021-02-13,42 357 | 2021-02-14,42 358 | 2021-02-15,42 359 | 2021-02-16,42 360 | 2021-02-17,42 361 | 2021-02-18,42 362 | 2021-02-19,42 363 | 2021-02-20,42 364 | 2021-02-21,42 365 | 2021-02-22,42 366 | 2021-02-23,42 367 | 2021-02-24,42 368 | 2021-02-25,42 369 | 2021-02-26,42 370 | 2021-02-27,42 371 | 2021-02-28,42 372 | 2021-03-01,42 373 | 2021-03-02,42 374 | 2021-03-03,42 375 | 2021-03-04,42 376 | 2021-03-05,42 377 | 2021-03-06,42 378 | 2021-03-07,42 379 | 2021-03-08,42 380 | 2021-03-09,42 381 | 2021-03-10,42 382 | 2021-03-11,42 383 | 2021-03-12,42 384 | 2021-03-13,42 385 | 2021-03-14,42 386 | 2021-03-15,42 387 | 2021-03-16,42 388 | 2021-03-17,42 389 | 2021-03-18,42 390 | 2021-03-19,42 391 | 2021-03-20,42 392 | 2021-03-21,42 393 | 2021-03-22,42 394 | 2021-03-23,42 395 | 2021-03-24,42 396 | 2021-03-25,42 397 | 2021-03-26,42 398 | 2021-03-27,42 399 | 2021-03-28,42 400 | 2021-03-29,42 401 | 2021-03-30,42 402 | 2021-03-31,42 403 | 2021-04-01,42 404 | 2021-04-02,42 405 | 2021-04-03,42 406 | 2021-04-04,42 407 | 2021-04-05,42 408 | 2021-04-06,42 409 | 2021-04-07,42 410 | 2021-04-08,42 411 | 2021-04-09,42 412 | 2021-04-10,42 413 | 2021-04-11,42 414 | 2021-04-12,42 415 | 2021-04-13,42 416 | 2021-04-14,42 417 | 2021-04-15,42 418 | 2021-04-16,42 419 | 2021-04-17,42 420 | 2021-04-18,42 421 | 2021-04-19,42 422 | 2021-04-20,42 423 | 2021-04-21,42 424 | 2021-04-22,42 425 | 2021-04-23,42 426 | 2021-04-24,42 427 | 2021-04-25,42 428 | 2021-04-26,42 429 | 2021-04-27,42 430 | 2021-04-28,42 431 | 2021-04-29,42 432 | 2021-04-30,42 433 | 2021-05-01,42 434 | 2021-05-02,42 435 | 2021-05-03,42 436 | 2021-05-04,42 437 | 2021-05-05,42 438 | 2021-05-06,42 439 | 2021-05-07,42 440 | 2021-05-08,42 441 | 2021-05-09,42 442 | 2021-05-10,42 443 | 2021-05-11,42 444 | 2021-05-12,42 445 | 2021-05-13,42 446 | 2021-05-14,42 447 | 2021-05-15,42 448 | 2021-05-16,42 449 | 2021-05-17,42 450 | 2021-05-18,42 451 | 2021-05-19,42 452 | 2021-05-20,42 453 | 2021-05-21,42 454 | 2021-05-22,42 455 | 2021-05-23,42 456 | 2021-05-24,42 457 | 2021-05-25,42 458 | 2021-05-26,42 459 | 2021-05-27,42 460 | 2021-05-28,42 461 | 2021-05-29,42 462 | 2021-05-30,42 463 | 2021-05-31,42 464 | 2021-06-01,42 465 | 2021-06-02,42 466 | 2021-06-03,42 467 | 2021-06-04,42 468 | 2021-06-05,42 469 | 2021-06-06,42 470 | 2021-06-07,42 471 | 2021-06-08,42 472 | 2021-06-09,42 473 | 2021-06-10,42 474 | 2021-06-11,42 475 | 2021-06-12,42 476 | 2021-06-13,42 477 | 2021-06-14,42 478 | 2021-06-15,42 479 | 2021-06-16,42 480 | 2021-06-17,42 481 | 2021-06-18,42 482 | 2021-06-19,42 483 | 2021-06-20,42 484 | 2021-06-21,42 485 | 2021-06-22,42 486 | 2021-06-23,42 487 | 2021-06-24,42 488 | 2021-06-25,42 489 | 2021-06-26,42 490 | 2021-06-27,42 491 | 2021-06-28,42 492 | 2021-06-29,42 493 | 2021-06-30,42 494 | 2021-07-01,42 495 | 2021-07-02,42 496 | 2021-07-03,42 497 | 2021-07-04,42 498 | 2021-07-05,42 499 | 2021-07-06,42 500 | 2021-07-07,42 501 | 2021-07-08,42 502 | -------------------------------------------------------------------------------- /tests/test_datasets/infer_freq_datasets/_APU.csv: -------------------------------------------------------------------------------- 1 | DATE,APU000072610 2 | 1978-11-01,42 3 | 1978-12-01,42 4 | 1979-01-01,42 5 | 1979-02-01,42 6 | 1979-03-01,42 7 | 1979-04-01,42 8 | 1979-05-01,42 9 | 1979-06-01,42 10 | 1979-07-01,42 11 | 1979-08-01,42 12 | 1979-09-01,42 13 | 1979-10-01,42 14 | 1979-11-01,42 15 | 1979-12-01,42 16 | 1980-01-01,42 17 | 1980-02-01,42 18 | 1980-03-01,42 19 | 1980-04-01,42 20 | 1980-05-01,42 21 | 1980-06-01,42 22 | 1980-07-01,42 23 | 1980-08-01,42 24 | 1980-09-01,42 25 | 1980-10-01,42 26 | 1980-11-01,42 27 | 1980-12-01,42 28 | 1981-01-01,42 29 | 1981-02-01,42 30 | 1981-03-01,42 31 | 1981-04-01,42 32 | 1981-05-01,42 33 | 1981-06-01,42 34 | 1981-07-01,42 35 | 1981-08-01,42 36 | 1981-09-01,42 37 | 1981-10-01,42 38 | 1981-11-01,42 39 | 1981-12-01,42 40 | 1982-01-01,42 41 | 1982-02-01,42 42 | 1982-03-01,42 43 | 1982-04-01,42 44 | 1982-05-01,42 45 | 1982-06-01,42 46 | 1982-07-01,42 47 | 1982-08-01,42 48 | 1982-09-01,42 49 | 1982-10-01,42 50 | 1982-11-01,42 51 | 1982-12-01,42 52 | 1983-01-01,42 53 | 1983-02-01,42 54 | 1983-03-01,42 55 | 1983-04-01,42 56 | 1983-05-01,42 57 | 1983-06-01,42 58 | 1983-07-01,42 59 | 1983-08-01,42 60 | 1983-09-01,42 61 | 1983-10-01,42 62 | 1983-11-01,42 63 | 1983-12-01,42 64 | 1984-01-01,42 65 | 1984-02-01,42 66 | 1984-03-01,42 67 | 1984-04-01,42 68 | 1984-05-01,42 69 | 1984-06-01,42 70 | 1984-07-01,42 71 | 1984-08-01,42 72 | 1984-09-01,42 73 | 1984-10-01,42 74 | 1984-11-01,42 75 | 1984-12-01,42 76 | 1985-01-01,42 77 | 1985-02-01,42 78 | 1985-03-01,42 79 | 1985-04-01,42 80 | 1985-05-01,42 81 | 1985-06-01,42 82 | 1985-07-01,42 83 | 1985-08-01,42 84 | 1985-09-01,42 85 | 1985-10-01,42 86 | 1985-11-01,42 87 | 1985-12-01,42 88 | 1986-01-01,42 89 | 1986-02-01,42 90 | 1986-03-01,42 91 | 1986-04-01,42 92 | 1986-05-01,42 93 | 1986-06-01,42 94 | 1986-07-01,42 95 | 1986-08-01,42 96 | 1986-09-01,42 97 | 1986-10-01,42 98 | 1986-11-01,42 99 | 1986-12-01,42 100 | 1987-01-01,42 101 | 1987-02-01,42 102 | 1987-03-01,42 103 | 1987-04-01,42 104 | 1987-05-01,42 105 | 1987-06-01,42 106 | 1987-07-01,42 107 | 1987-08-01,42 108 | 1987-09-01,42 109 | 1987-10-01,42 110 | 1987-11-01,42 111 | 1987-12-01,42 112 | 1988-01-01,42 113 | 1988-02-01,42 114 | 1988-03-01,42 115 | 1988-04-01,42 116 | 1988-05-01,42 117 | 1988-06-01,42 118 | 1988-07-01,42 119 | 1988-08-01,42 120 | 1988-09-01,42 121 | 1988-10-01,42 122 | 1988-11-01,42 123 | 1988-12-01,42 124 | 1989-01-01,42 125 | 1989-02-01,42 126 | 1989-03-01,42 127 | 1989-04-01,42 128 | 1989-05-01,42 129 | 1989-06-01,42 130 | 1989-07-01,42 131 | 1989-08-01,42 132 | 1989-09-01,42 133 | 1989-10-01,42 134 | 1989-11-01,42 135 | 1989-12-01,42 136 | 1990-01-01,42 137 | 1990-02-01,42 138 | 1990-03-01,42 139 | 1990-04-01,42 140 | 1990-05-01,42 141 | 1990-06-01,42 142 | 1990-07-01,42 143 | 1990-08-01,42 144 | 1990-09-01,42 145 | 1990-10-01,42 146 | 1990-11-01,42 147 | 1990-12-01,42 148 | 1991-01-01,42 149 | 1991-02-01,42 150 | 1991-03-01,42 151 | 1991-04-01,42 152 | 1991-05-01,42 153 | 1991-06-01,42 154 | 1991-07-01,42 155 | 1991-08-01,42 156 | 1991-09-01,42 157 | 1991-10-01,42 158 | 1991-11-01,42 159 | 1991-12-01,42 160 | 1992-01-01,42 161 | 1992-02-01,42 162 | 1992-03-01,42 163 | 1992-04-01,42 164 | 1992-05-01,42 165 | 1992-06-01,42 166 | 1992-07-01,42 167 | 1992-08-01,42 168 | 1992-09-01,42 169 | 1992-10-01,42 170 | 1992-11-01,42 171 | 1992-12-01,42 172 | 1993-01-01,42 173 | 1993-02-01,42 174 | 1993-03-01,42 175 | 1993-04-01,42 176 | 1993-05-01,42 177 | 1993-06-01,42 178 | 1993-07-01,42 179 | 1993-08-01,42 180 | 1993-09-01,42 181 | 1993-10-01,42 182 | 1993-11-01,42 183 | 1993-12-01,42 184 | 1994-01-01,42 185 | 1994-02-01,42 186 | 1994-03-01,42 187 | 1994-04-01,42 188 | 1994-05-01,42 189 | 1994-06-01,42 190 | 1994-07-01,42 191 | 1994-08-01,42 192 | 1994-09-01,42 193 | 1994-10-01,42 194 | 1994-11-01,42 195 | 1994-12-01,42 196 | 1995-01-01,42 197 | 1995-02-01,42 198 | 1995-03-01,42 199 | 1995-04-01,42 200 | 1995-05-01,42 201 | 1995-06-01,42 202 | 1995-07-01,42 203 | 1995-08-01,42 204 | 1995-09-01,42 205 | 1995-10-01,42 206 | 1995-11-01,42 207 | 1995-12-01,42 208 | 1996-01-01,42 209 | 1996-02-01,42 210 | 1996-03-01,42 211 | 1996-04-01,42 212 | 1996-05-01,42 213 | 1996-06-01,42 214 | 1996-07-01,42 215 | 1996-08-01,42 216 | 1996-09-01,42 217 | 1996-10-01,42 218 | 1996-11-01,42 219 | 1996-12-01,42 220 | 1997-01-01,42 221 | 1997-02-01,42 222 | 1997-03-01,42 223 | 1997-04-01,42 224 | 1997-05-01,42 225 | 1997-06-01,42 226 | 1997-07-01,42 227 | 1997-08-01,42 228 | 1997-09-01,42 229 | 1997-10-01,42 230 | 1997-11-01,42 231 | 1997-12-01,42 232 | 1998-01-01,42 233 | 1998-02-01,42 234 | 1998-03-01,42 235 | 1998-04-01,42 236 | 1998-05-01,42 237 | 1998-06-01,42 238 | 1998-07-01,42 239 | 1998-08-01,42 240 | 1998-09-01,42 241 | 1998-10-01,42 242 | 1998-11-01,42 243 | 1998-12-01,42 244 | 1999-01-01,42 245 | 1999-02-01,42 246 | 1999-03-01,42 247 | 1999-04-01,42 248 | 1999-05-01,42 249 | 1999-06-01,42 250 | 1999-07-01,42 251 | 1999-08-01,42 252 | 1999-09-01,42 253 | 1999-10-01,42 254 | 1999-11-01,42 255 | 1999-12-01,42 256 | 2000-01-01,42 257 | 2000-02-01,42 258 | 2000-03-01,42 259 | 2000-04-01,42 260 | 2000-05-01,42 261 | 2000-06-01,42 262 | 2000-07-01,42 263 | 2000-08-01,42 264 | 2000-09-01,42 265 | 2000-10-01,42 266 | 2000-11-01,42 267 | 2000-12-01,42 268 | 2001-01-01,42 269 | 2001-02-01,42 270 | 2001-03-01,42 271 | 2001-04-01,42 272 | 2001-05-01,42 273 | 2001-06-01,42 274 | 2001-07-01,42 275 | 2001-08-01,42 276 | 2001-09-01,42 277 | 2001-10-01,42 278 | 2001-11-01,42 279 | 2001-12-01,42 280 | 2002-01-01,42 281 | 2002-02-01,42 282 | 2002-03-01,42 283 | 2002-04-01,42 284 | 2002-05-01,42 285 | 2002-06-01,42 286 | 2002-07-01,42 287 | 2002-08-01,42 288 | 2002-09-01,42 289 | 2002-10-01,42 290 | 2002-11-01,42 291 | 2002-12-01,42 292 | 2003-01-01,42 293 | 2003-02-01,42 294 | 2003-03-01,42 295 | 2003-04-01,42 296 | 2003-05-01,42 297 | 2003-06-01,42 298 | 2003-07-01,42 299 | 2003-08-01,42 300 | 2003-09-01,42 301 | 2003-10-01,42 302 | 2003-11-01,42 303 | 2003-12-01,42 304 | 2004-01-01,42 305 | 2004-02-01,42 306 | 2004-03-01,42 307 | 2004-04-01,42 308 | 2004-05-01,42 309 | 2004-06-01,42 310 | 2004-07-01,42 311 | 2004-08-01,42 312 | 2004-09-01,42 313 | 2004-10-01,42 314 | 2004-11-01,42 315 | 2004-12-01,42 316 | 2005-01-01,42 317 | 2005-02-01,42 318 | 2005-03-01,42 319 | 2005-04-01,42 320 | 2005-05-01,42 321 | 2005-06-01,42 322 | 2005-07-01,42 323 | 2005-08-01,42 324 | 2005-09-01,42 325 | 2005-10-01,42 326 | 2005-11-01,42 327 | 2005-12-01,42 328 | 2006-01-01,42 329 | 2006-02-01,42 330 | 2006-03-01,42 331 | 2006-04-01,42 332 | 2006-05-01,42 333 | 2006-06-01,42 334 | 2006-07-01,42 335 | 2006-08-01,42 336 | 2006-09-01,42 337 | 2006-10-01,42 338 | 2006-11-01,42 339 | 2006-12-01,42 340 | 2007-01-01,42 341 | 2007-02-01,42 342 | 2007-03-01,42 343 | 2007-04-01,42 344 | 2007-05-01,42 345 | 2007-06-01,42 346 | 2007-07-01,42 347 | 2007-08-01,42 348 | 2007-09-01,42 349 | 2007-10-01,42 350 | 2007-11-01,42 351 | 2007-12-01,42 352 | 2008-01-01,42 353 | 2008-02-01,42 354 | 2008-03-01,42 355 | 2008-04-01,42 356 | 2008-05-01,42 357 | 2008-06-01,42 358 | 2008-07-01,42 359 | 2008-08-01,42 360 | 2008-09-01,42 361 | 2008-10-01,42 362 | 2008-11-01,42 363 | 2008-12-01,42 364 | 2009-01-01,42 365 | 2009-02-01,42 366 | 2009-03-01,42 367 | 2009-04-01,42 368 | 2009-05-01,42 369 | 2009-06-01,42 370 | 2009-07-01,42 371 | 2009-08-01,42 372 | 2009-09-01,42 373 | 2009-10-01,42 374 | 2009-11-01,42 375 | 2009-12-01,42 376 | 2010-01-01,42 377 | 2010-02-01,42 378 | 2010-03-01,42 379 | 2010-04-01,42 380 | 2010-05-01,42 381 | 2010-06-01,42 382 | 2010-07-01,42 383 | 2010-08-01,42 384 | 2010-09-01,42 385 | 2010-10-01,42 386 | 2010-11-01,42 387 | 2010-12-01,42 388 | 2011-01-01,42 389 | 2011-02-01,42 390 | 2011-03-01,42 391 | 2011-04-01,42 392 | 2011-05-01,42 393 | 2011-06-01,42 394 | 2011-07-01,42 395 | 2011-08-01,42 396 | 2011-09-01,42 397 | 2011-10-01,42 398 | 2011-11-01,42 399 | 2011-12-01,42 400 | 2012-01-01,42 401 | 2012-02-01,42 402 | 2012-03-01,42 403 | 2012-04-01,42 404 | 2012-05-01,42 405 | 2012-06-01,42 406 | 2012-07-01,42 407 | 2012-08-01,42 408 | 2012-09-01,42 409 | 2012-10-01,42 410 | 2012-11-01,42 411 | 2012-12-01,42 412 | 2013-01-01,42 413 | 2013-02-01,42 414 | 2013-03-01,42 415 | 2013-04-01,42 416 | 2013-05-01,42 417 | 2013-06-01,42 418 | 2013-07-01,42 419 | 2013-08-01,42 420 | 2013-09-01,42 421 | 2013-10-01,42 422 | 2013-11-01,42 423 | 2013-12-01,42 424 | 2014-01-01,42 425 | 2014-02-01,42 426 | 2014-03-01,42 427 | 2014-04-01,42 428 | 2014-05-01,42 429 | 2014-06-01,42 430 | 2014-07-01,42 431 | 2014-08-01,42 432 | 2014-09-01,42 433 | 2014-10-01,42 434 | 2014-11-01,42 435 | 2014-12-01,42 436 | 2015-01-01,42 437 | 2015-02-01,42 438 | 2015-03-01,42 439 | 2015-04-01,42 440 | 2015-05-01,42 441 | 2015-06-01,42 442 | 2015-07-01,42 443 | 2015-08-01,42 444 | 2015-09-01,42 445 | 2015-10-01,42 446 | 2015-11-01,42 447 | 2015-12-01,42 448 | 2016-01-01,42 449 | 2016-02-01,42 450 | 2016-03-01,42 451 | 2016-04-01,42 452 | 2016-05-01,42 453 | 2016-06-01,42 454 | 2016-07-01,42 455 | 2016-08-01,42 456 | 2016-09-01,42 457 | 2016-10-01,42 458 | 2016-11-01,42 459 | 2016-12-01,42 460 | 2017-01-01,42 461 | 2017-02-01,42 462 | 2017-03-01,42 463 | 2017-04-01,42 464 | 2017-05-01,42 465 | 2017-06-01,42 466 | 2017-07-01,42 467 | 2017-08-01,42 468 | 2017-09-01,42 469 | 2017-10-01,42 470 | 2017-11-01,42 471 | 2017-12-01,42 472 | 2018-01-01,42 473 | 2018-02-01,42 474 | 2018-03-01,42 475 | 2018-04-01,42 476 | 2018-05-01,42 477 | 2018-06-01,42 478 | 2018-07-01,42 479 | 2018-08-01,42 480 | 2018-09-01,42 481 | 2018-10-01,42 482 | 2018-11-01,42 483 | 2018-12-01,42 484 | 2019-01-01,42 485 | 2019-02-01,42 486 | 2019-03-01,42 487 | 2019-04-01,42 488 | 2019-05-01,42 489 | 2019-06-01,42 490 | 2019-07-01,42 491 | 2019-08-01,42 492 | 2019-09-01,42 493 | 2019-10-01,42 494 | 2019-11-01,42 495 | 2019-12-01,42 496 | 2020-01-01,42 497 | 2020-02-01,42 498 | 2020-03-01,42 499 | 2020-04-01,42 500 | 2020-05-01,42 501 | 2020-06-01,42 502 | 2020-07-01,42 503 | 2020-08-01,42 504 | 2020-09-01,42 505 | 2020-10-01,42 506 | 2020-11-01,42 507 | 2020-12-01,42 508 | 2021-01-01,42 509 | 2021-02-01,42 510 | 2021-03-01,42 511 | 2021-04-01,42 512 | 2021-05-01,42 513 | 2021-06-01,42 514 | 2021-07-01,42 515 | 2021-08-01,42 516 | 2021-09-01,42 517 | 2021-10-01,42 518 | 2021-11-01,42 519 | 2021-12-01,42 520 | 2022-01-01,42 521 | 2022-02-01,42 522 | 2022-03-01,42 523 | 2022-04-01,42 524 | 2022-05-01,42 525 | 2022-06-01,42 526 | 2022-07-01,42 527 | 2022-08-01,42 528 | 2022-09-01,42 529 | 2022-10-01,42 530 | 2022-11-01,42 531 | 2022-12-01,42 532 | 2023-01-01,42 533 | -------------------------------------------------------------------------------- /tests/test_datasets/infer_freq_datasets/_AirlinePassengers.csv: -------------------------------------------------------------------------------- 1 | Month,Passengers 2 | 1980-01,42 3 | 1980-02,42 4 | 1980-03,42 5 | 1980-04,42 6 | 1980-05,42 7 | 1980-06,42 8 | 1980-07,42 9 | 1980-08,42 10 | 1980-09,42 11 | 1980-10,42 12 | 1980-11,42 13 | 1980-12,42 14 | 1981-01,42 15 | 1981-02,42 16 | 1981-03,42 17 | 1981-04,42 18 | 1981-05,42 19 | 1981-06,42 20 | 1981-07,42 21 | 1981-08,42 22 | 1981-09,42 23 | 1981-10,42 24 | 1981-11,42 25 | 1981-12,42 26 | 1982-01,42 27 | 1982-02,42 28 | 1982-03,42 29 | 1982-04,42 30 | 1982-05,42 31 | 1982-06,42 32 | 1982-07,42 33 | 1982-08,42 34 | 1982-09,42 35 | 1982-10,42 36 | 1982-11,42 37 | 1982-12,42 38 | 1983-01,42 39 | 1983-02,42 40 | 1983-03,42 41 | 1983-04,42 42 | 1983-05,42 43 | 1983-06,42 44 | 1983-07,42 45 | 1983-08,42 46 | 1983-09,42 47 | 1983-10,42 48 | 1983-11,42 49 | 1983-12,42 50 | 1984-01,42 51 | 1984-02,42 52 | 1984-03,42 53 | 1984-04,42 54 | 1984-05,42 55 | 1984-06,42 56 | 1984-07,42 57 | 1984-08,42 58 | 1984-09,42 59 | 1984-10,42 60 | 1984-11,42 61 | 1984-12,42 62 | 1985-01,42 63 | 1985-02,42 64 | 1985-03,42 65 | 1985-04,42 66 | 1985-05,42 67 | 1985-06,42 68 | 1985-07,42 69 | 1985-08,42 70 | 1985-09,42 71 | 1985-10,42 72 | 1985-11,42 73 | 1985-12,42 74 | 1986-01,42 75 | 1986-02,42 76 | 1986-03,42 77 | 1986-04,42 78 | 1986-05,42 79 | 1986-06,42 80 | 1986-07,42 81 | 1986-08,42 82 | 1986-09,42 83 | 1986-10,42 84 | 1986-11,42 85 | 1986-12,42 86 | 1987-01,42 87 | 1987-02,42 88 | 1987-03,42 89 | 1987-04,42 90 | 1987-05,42 91 | 1987-06,42 92 | 1987-07,42 93 | 1987-08,42 94 | 1987-09,42 95 | 1987-10,42 96 | 1987-11,42 97 | 1987-12,42 98 | 1988-01,42 99 | 1988-02,42 100 | 1988-03,42 101 | 1988-04,42 102 | 1988-05,42 103 | 1988-06,42 104 | 1988-07,42 105 | 1988-08,42 106 | 1988-09,42 107 | 1988-10,42 108 | 1988-11,42 109 | 1988-12,42 110 | 1989-01,42 111 | 1989-02,42 112 | 1989-03,42 113 | 1989-04,42 114 | 1989-05,42 115 | 1989-06,42 116 | 1989-07,42 117 | 1989-08,42 118 | 1989-09,42 119 | 1989-10,42 120 | 1989-11,42 121 | 1989-12,42 122 | 1990-01,42 123 | 1990-02,42 124 | 1990-03,42 125 | 1990-04,42 126 | 1990-05,42 127 | 1990-06,42 128 | 1990-07,42 129 | 1990-08,42 130 | 1990-09,42 131 | 1990-10,42 132 | 1990-11,42 133 | 1990-12,42 134 | -------------------------------------------------------------------------------- /tests/test_datasets/infer_freq_datasets/_StockExample.csv: -------------------------------------------------------------------------------- 1 | Data,Ultimo 2 | 2021-01-08,42 3 | 2021-01-15,42 4 | 2021-01-22,42 5 | 2021-01-29,42 6 | 2021-02-05,42 7 | 2021-02-12,42 8 | 2021-02-19,42 9 | 2021-02-26,42 10 | 2021-03-05,42 11 | 2021-03-12,42 12 | 2021-03-19,42 13 | 2021-03-26,42 14 | 2021-04-09,42 15 | 2021-04-16,42 16 | 2021-04-23,42 17 | 2021-04-30,42 18 | 2021-05-07,42 19 | 2021-05-14,42 20 | 2021-05-21,42 21 | 2021-05-28,42 22 | 2021-06-04,42 23 | 2021-06-11,42 24 | 2021-06-18,42 25 | 2021-06-25,42 26 | 2021-07-02,42 27 | 2021-07-09,42 28 | 2021-07-16,42 29 | 2021-07-23,42 30 | 2021-07-30,42 31 | 2021-08-06,42 32 | 2021-08-13,42 33 | 2021-08-20,42 34 | 2021-08-27,42 35 | 2021-09-03,42 36 | 2021-09-10,42 37 | 2021-09-17,42 38 | 2021-09-24,42 39 | 2021-10-01,42 40 | 2021-10-08,42 41 | 2021-10-15,42 42 | 2021-10-22,42 43 | 2021-10-29,42 44 | 2021-11-05,42 45 | 2021-11-12,42 46 | 2021-11-19,42 47 | 2021-11-26,42 48 | 2021-12-03,42 49 | 2021-12-10,42 50 | 2021-12-17,42 51 | 2022-01-07,42 52 | 2022-01-14,42 53 | 2022-01-21,42 54 | 2022-01-28,42 55 | 2022-02-04,42 56 | 2022-02-11,42 57 | 2022-02-18,42 58 | 2022-02-25,42 59 | 2022-03-04,42 60 | 2022-03-11,42 61 | 2022-03-18,42 62 | 2022-03-25,42 63 | 2022-04-01,42 64 | 2022-04-08,42 65 | 2022-04-22,42 66 | 2022-04-29,42 67 | 2022-05-06,42 68 | 2022-05-13,42 69 | 2022-05-20,42 70 | 2022-05-27,42 71 | 2022-06-03,42 72 | 2022-06-10,42 73 | 2022-06-17,42 74 | 2022-06-24,42 75 | 2022-07-01,42 76 | 2022-07-08,42 77 | 2022-07-15,42 78 | 2022-07-22,42 79 | 2022-07-29,42 80 | 2022-08-05,42 81 | 2022-08-12,42 82 | 2022-08-19,42 83 | 2022-08-26,42 84 | 2022-09-02,42 85 | 2022-09-09,42 86 | 2022-09-16,42 87 | 2022-09-23,42 88 | 2022-09-30,42 89 | 2022-10-07,42 90 | 2022-10-14,42 91 | 2022-10-21,42 92 | 2022-10-28,42 93 | 2022-11-04,42 94 | 2022-11-11,42 95 | 2022-11-18,42 96 | 2022-11-25,42 97 | 2022-12-02,42 98 | 2022-12-09,42 99 | 2022-12-16,42 100 | 2022-12-23,42 101 | 2022-12-30,42 102 | 2023-01-06,42 103 | 2023-01-13,42 104 | 2023-01-20,42 105 | 2023-01-27,42 106 | 2023-02-03,42 107 | 2023-02-10,42 108 | 2023-02-17,42 109 | 2023-02-24,42 110 | 2023-03-03,42 111 | 2023-03-10,42 112 | 2023-03-17,42 113 | 2023-03-24,42 114 | 2023-03-31,42 115 | 2023-04-14,42 116 | 2023-04-21,42 117 | -------------------------------------------------------------------------------- /tests/test_datasets/test_1.csv: -------------------------------------------------------------------------------- 1 | first_column,second_column,third_column 2 | 2020-02-25T00:00:00,2,3 3 | 2020-02-26T00:00:00,5,6 4 | 2020-02-27T00:00:00,8,9 5 | 6 | -------------------------------------------------------------------------------- /tests/test_datasets/test_1_1.csv: -------------------------------------------------------------------------------- 1 | first_column,second_column,third_column 2 | 2011-01-31T18:00:00,2,3 3 | 2011-02-28T18:00:00,5,6 4 | 2011-03-31T18:00:00,8,9 5 | 6 | -------------------------------------------------------------------------------- /tests/test_datasets/test_1_2.csv: -------------------------------------------------------------------------------- 1 | first_column,second_column,third_column 2 | 2020-02-25T00:00:00,2,3 3 | 2020-02-26T00:00:00,5,6 4 | 2020-02-27T00:00:00,8,9 5 | 2020-02-28T00:00:00,11,12 6 | 7 | -------------------------------------------------------------------------------- /tests/test_datasets/test_2.csv: -------------------------------------------------------------------------------- 1 | first_column,second_column,third_column 2 | 2020-02-25T18:00:00,2,3 3 | 2020-02-26T18:00:00,5,8 4 | 2020-02-27T18:00:00,8,15 5 | 6 | -------------------------------------------------------------------------------- /tests/test_datasets/test_3.csv: -------------------------------------------------------------------------------- 1 | first_column,second_column 2 | 2020-02-25T18:00:00,8 3 | 2020-02-26T18:00:00,8 4 | 2020-02-27T18:00:00,8 5 | 2020-02-28T18:00:00,8 6 | 2020-03-01T18:00:00,8 7 | 2020-03-02T18:00:00,8 8 | 2020-03-03T18:00:00,8 9 | 2020-03-04T18:00:00,8 10 | 2020-03-05T18:00:00,8 11 | 2020-03-06T18:00:00,8 12 | 13 | -------------------------------------------------------------------------------- /tests/test_datasets/test_4.csv: -------------------------------------------------------------------------------- 1 | first_column,second_column 2 | 2020-02-25T18:00:00,1 3 | 2020-02-26T18:00:00,2 4 | 2020-02-26T18:00:00,3 5 | 2020-02-27T18:00:00,4 6 | 7 | -------------------------------------------------------------------------------- /tests/test_datasets/test_5.csv: -------------------------------------------------------------------------------- 1 | first_column,second_column,third_column 2 | Nov. 2020,2,3 3 | Dic. 2020,5,6 4 | Gen. 2021,8,9 5 | 6 | -------------------------------------------------------------------------------- /tests/test_datasets/test_5_1.csv: -------------------------------------------------------------------------------- 1 | first_column,second_column,third_column 2 | 1959-01,2,3 3 | 1959-02,5,6 4 | 1959-03,8,9 5 | 6 | -------------------------------------------------------------------------------- /tests/test_datasets/test_6.csv: -------------------------------------------------------------------------------- 1 | first_column,second_column 2 | 2020-02-25T12:30:14,1 3 | 2020-02-26T12:30:12,1 4 | 2020-02-27T11:22:11,2 5 | 2020-02-28T12:22:12,3 6 | 2020-03-19T11:24:13,4 7 | 2020-03-20T10:22:13,4 8 | 2020-03-21T11:22:13,4 9 | 2020-04-27T11:22:15,5 10 | -------------------------------------------------------------------------------- /tests/test_datasets/test_6_expected.csv: -------------------------------------------------------------------------------- 1 | first_column,second_column 2 | 2020-02-25,1.0 3 | 2020-02-26,1.0 4 | 2020-02-27,2.0 5 | 2020-02-28,3.0 6 | 2020-02-29,3.05 7 | 2020-03-01,3.1 8 | 2020-03-02,3.15 9 | 2020-03-03,3.2 10 | 2020-03-04,3.25 11 | 2020-03-05,3.3 12 | 2020-03-06,3.35 13 | 2020-03-07,3.4 14 | 2020-03-08,3.45 15 | 2020-03-09,3.5 16 | 2020-03-10,3.55 17 | 2020-03-11,3.6 18 | 2020-03-12,3.65 19 | 2020-03-13,3.7 20 | 2020-03-14,3.75 21 | 2020-03-15,3.8 22 | 2020-03-16,3.85 23 | 2020-03-17,3.9 24 | 2020-03-18,3.95 25 | 2020-03-19,4.0 26 | 2020-03-20,4.0 27 | 2020-03-21,4.0 28 | 2020-03-22,4.027027027027027 29 | 2020-03-23,4.054054054054054 30 | 2020-03-24,4.081081081081081 31 | 2020-03-25,4.108108108108108 32 | 2020-03-26,4.135135135135135 33 | 2020-03-27,4.162162162162162 34 | 2020-03-28,4.1891891891891895 35 | 2020-03-29,4.216216216216216 36 | 2020-03-30,4.243243243243243 37 | 2020-03-31,4.27027027027027 38 | 2020-04-01,4.297297297297297 39 | 2020-04-02,4.324324324324325 40 | 2020-04-03,4.351351351351352 41 | 2020-04-04,4.378378378378378 42 | 2020-04-05,4.405405405405405 43 | 2020-04-06,4.4324324324324325 44 | 2020-04-07,4.45945945945946 45 | 2020-04-08,4.486486486486487 46 | 2020-04-09,4.513513513513514 47 | 2020-04-10,4.54054054054054 48 | 2020-04-11,4.5675675675675675 49 | 2020-04-12,4.594594594594595 50 | 2020-04-13,4.621621621621622 51 | 2020-04-14,4.648648648648649 52 | 2020-04-15,4.675675675675675 53 | 2020-04-16,4.702702702702703 54 | 2020-04-17,4.72972972972973 55 | 2020-04-18,4.756756756756757 56 | 2020-04-19,4.783783783783784 57 | 2020-04-20,4.8108108108108105 58 | 2020-04-21,4.837837837837838 59 | 2020-04-22,4.864864864864865 60 | 2020-04-23,4.891891891891892 61 | 2020-04-24,4.918918918918919 62 | 2020-04-25,4.945945945945946 63 | 2020-04-26,4.972972972972973 64 | 2020-04-27,5.0 65 | -------------------------------------------------------------------------------- /tests/test_datasets/test_7.csv: -------------------------------------------------------------------------------- 1 | date,a,b 2 | 2000-01-01,1,101 3 | 2000-01-02,2,102 4 | 2000-01-03,3,103 5 | 2000-01-04,4,104 6 | 2000-01-05,5,105 7 | 2000-01-06,6,106 8 | 2000-01-07,7,107 9 | 2000-01-08,8,108 10 | 2000-01-09,9,109 11 | 2000-01-10,10,110 12 | 2000-01-11,11,111 13 | 2000-01-12,12,112 14 | 2000-01-13,13,113 15 | 2000-01-14,14,114 16 | 2000-01-15,15,115 17 | 2000-01-16,16,116 18 | 2000-01-17,17,117 19 | 2000-01-18,18,118 20 | 2000-01-19,19,119 21 | 2000-01-20,20,120 22 | 2000-01-21,21,121 23 | 2000-01-22,22,122 24 | 2000-01-23,23,123 25 | 2000-01-24,24,124 26 | 2000-01-25,25,125 27 | 2000-01-26,26,126 28 | 2000-01-27,27,127 29 | 2000-01-28,28,128 30 | 2000-01-29,29,129 31 | 2000-01-30,30,130 32 | 2000-01-31,31,131 33 | 2000-02-01,32,132 34 | 2000-02-02,33,133 35 | 2000-02-03,34,134 36 | 2000-02-04,35,135 37 | 2000-02-05,36,136 38 | 2000-02-06,37,137 39 | 2000-02-07,38,138 40 | 2000-02-08,39,139 41 | 2000-02-09,40,140 42 | 2000-02-10,41,141 43 | 2000-02-11,42,142 44 | 2000-02-12,43,143 45 | 2000-02-13,44,144 46 | 2000-02-14,45,145 47 | 2000-02-15,46,146 48 | 2000-02-16,47,147 49 | 2000-02-17,48,148 50 | 2000-02-18,49,149 51 | 2000-02-19,50,150 52 | 2000-02-20,51,151 53 | 2000-02-21,52,152 54 | 2000-02-22,53,153 55 | 2000-02-23,54,154 56 | 2000-02-24,55,155 57 | 2000-02-25,56,156 58 | 2000-02-26,57,157 59 | 2000-02-27,58,158 60 | 2000-02-28,59,159 61 | 2000-02-29,60,160 62 | 2000-03-01,61,161 63 | 2000-03-02,62,162 64 | 2000-03-03,63,163 65 | 2000-03-04,64,164 66 | 2000-03-05,65,165 67 | 2000-03-06,66,166 68 | 2000-03-07,67,167 69 | 2000-03-08,68,168 70 | 2000-03-09,69,169 71 | 2000-03-10,70,170 72 | 2000-03-11,71,171 73 | 2000-03-12,72,172 74 | 2000-03-13,73,173 75 | 2000-03-14,74,174 76 | 2000-03-15,75,175 77 | 2000-03-16,76,176 78 | 2000-03-17,77,177 79 | 2000-03-18,78,178 80 | 2000-03-19,79,179 81 | 2000-03-20,80,180 82 | 2000-03-21,81,181 83 | 2000-03-22,82,182 84 | 2000-03-23,83,183 85 | 2000-03-24,84,184 86 | 2000-03-25,85,185 87 | 2000-03-26,86,186 88 | 2000-03-27,87,187 89 | 2000-03-28,88,188 90 | 2000-03-29,89,189 91 | 2000-03-30,90,190 92 | 2000-03-31,91,191 93 | 2000-04-01,92,192 94 | 2000-04-02,93,193 95 | 2000-04-03,94,194 96 | 2000-04-04,95,195 97 | 2000-04-05,96,196 98 | 2000-04-06,97,197 99 | 2000-04-07,98,198 100 | 2000-04-08,99,199 101 | 2000-04-09,100,200 102 | -------------------------------------------------------------------------------- /tests/test_datasets/test_covid.csv: -------------------------------------------------------------------------------- 1 | data,variazione_totale_positivi,nuovi_positivi 2 | 2020-08-31,873,996 3 | 2020-09-01,676,978 4 | 2020-09-02,1063,1326 5 | 2020-09-03,1098,1397 6 | 2020-09-04,1184,1733 7 | 2020-09-05,1095,1694 8 | 2020-09-06,884,1297 9 | 2020-09-07,915,1108 10 | 2020-09-08,796,1370 11 | 2020-09-09,945,1434 12 | 2020-09-10,974,1597 13 | 2020-09-11,1059,1616 14 | 2020-09-12,736,1501 15 | 2020-09-13,1006,1458 16 | 2020-09-14,678,1008 17 | 2020-09-15,525,1229 18 | 2020-09-16,820,1452 19 | 2020-09-17,881,1585 20 | 2020-09-18,1044,1907 21 | 2020-09-19,704,1638 22 | 2020-09-20,937,1587 23 | 2020-09-21,981,1350 24 | 2020-09-22,410,1392 25 | 2020-09-23,625,1640 26 | 2020-09-24,666,1786 27 | 2020-09-25,938,1912 28 | 2020-09-26,875,1869 29 | 2020-09-27,1025,1766 30 | 2020-09-28,705,1494 31 | 2020-09-29,307,1648 32 | 2020-09-30,633,1851 33 | 2020-10-01,1384,2548 34 | 2020-10-02,1350,2499 35 | 2020-10-03,1569,2844 36 | 2020-10-04,1863,2578 37 | 2020-10-05,1474,2257 38 | 2020-10-06,1231,2677 39 | 2020-10-07,2442,3678 40 | 2020-10-08,3376,4458 41 | 2020-10-09,4158,5372 42 | 2020-10-10,4719,5724 43 | 2020-10-11,4246,5456 44 | 2020-10-12,3689,4619 45 | 2020-10-13,4429,5901 46 | 2020-10-14,5252,7332 47 | 2020-10-15,6821,8804 48 | 2020-10-16,8046,10010 49 | 2020-10-17,9623,10925 50 | 2020-10-18,9302,11705 51 | 2020-10-19,7766,9338 52 | 2020-10-20,8736,10874 53 | 2020-10-21,12703,15199 54 | 2020-10-22,13860,16079 55 | 2020-10-23,16700,19143 56 | 2020-10-24,17180,19644 57 | 2020-10-25,19059,21273 58 | 2020-10-26,14443,17012 59 | 2020-10-27,18406,21994 60 | 2020-10-28,21367,24991 61 | 2020-10-29,22734,26831 62 | 2020-10-30,26595,31084 63 | 2020-10-31,25600,31758 64 | 2020-11-01,26743,29907 65 | 2020-11-02,18383,22253 66 | 2020-11-03,21630,28244 67 | 2020-11-04,25093,30550 68 | 2020-11-05,29113,34505 69 | 2020-11-06,26770,37809 70 | 2020-11-07,33418,39811 71 | 2020-11-08,26100,32616 72 | 2020-11-09,14698,25271 73 | 2020-11-10,16776,35098 74 | 2020-11-11,23248,32961 75 | 2020-11-12,21696,37978 76 | 2020-11-13,28872,40902 77 | 2020-11-14,24509,37255 78 | 2020-11-15,24055,33979 79 | 2020-11-16,5294,27354 80 | 2020-11-17,16026,32191 81 | 2020-11-18,9358,34282 82 | 2020-11-19,18503,36176 83 | 2020-11-20,15505,37242 84 | 2020-11-21,14570,34767 85 | 2020-11-22,14201,28337 86 | 2020-11-23,-9098,22930 87 | 2020-11-24,1537,23232 88 | 2020-11-25,-6689,25853 89 | 2020-11-26,4148,29003 90 | 2020-11-27,-7952,28352 91 | 2020-11-28,1415,26323 92 | 2020-11-29,6463,20648 93 | 2020-11-30,-7300,16377 94 | 2020-12-01,-8526,19350 95 | 2020-12-02,-18715,20709 96 | 2020-12-03,-1248,23225 97 | 2020-12-04,-2280,24099 98 | 2020-12-05,-3533,21052 99 | 2020-12-06,1137,18887 100 | 2020-12-07,-6487,13720 101 | 2020-12-08,-11294,14842 102 | -------------------------------------------------------------------------------- /tests/test_datasets/test_create_containers_extrareg_d.csv: -------------------------------------------------------------------------------- 1 | date,d 2 | 2000-01-01,3 3 | 2000-01-02,3 4 | 2000-01-03,3 5 | 2000-01-04,3 6 | 2000-01-05,3 7 | 2000-01-06,3 8 | 2000-01-07,3 9 | 2000-01-08,3 10 | 2000-01-09,3 11 | 2000-01-10,3 12 | 2000-01-11,3 13 | 2000-01-12,3 14 | 2000-01-13,3 15 | 2000-01-14,3 16 | 2000-01-15,3 17 | 2000-01-16,3 18 | 2000-01-17,3 19 | 2000-01-18,3 20 | 2000-01-19,3 21 | 2000-01-20,3 22 | 2000-01-21,3 23 | 2000-01-22,3 24 | 2000-01-23,3 25 | 2000-01-24,3 26 | 2000-01-25,3 27 | 2000-01-26,3 28 | 2000-01-27,3 29 | 2000-01-28,3 30 | 2000-01-29,3 31 | 2000-01-30,3 32 | 2000-01-31,3 33 | 2000-02-01,3 34 | 2000-02-02,3 35 | 2000-02-03,3 36 | 2000-02-04,3 37 | 2000-02-05,3 38 | 2000-02-06,3 39 | 2000-02-07,3 40 | 2000-02-08,3 41 | 2000-02-09,3 42 | 2000-02-10,3 43 | 2000-02-11,3 44 | 2000-02-12,3 45 | 2000-02-13,3 46 | 2000-02-14,3 47 | 2000-02-15,3 48 | -------------------------------------------------------------------------------- /tests/test_datasets/test_create_containers_extrareg_e.csv: -------------------------------------------------------------------------------- 1 | date,e 2 | 2000-01-01,3 3 | 2000-01-02,3 4 | 2000-01-03,3 5 | 2000-01-04,3 6 | 2000-01-05,3 7 | 2000-01-06,3 8 | 2000-01-07,3 9 | 2000-01-08,3 10 | 2000-01-09,3 11 | 2000-01-10,3 12 | 2000-01-11,3 13 | 2000-01-12,3 14 | 2000-01-13,3 15 | 2000-01-14,3 16 | 2000-01-15,3 17 | 2000-01-16,3 18 | 2000-01-17,3 19 | 2000-01-18,3 20 | 2000-01-19,3 21 | 2000-01-20,3 22 | 2000-01-21,3 23 | 2000-01-22,3 24 | 2000-01-23,3 25 | 2000-01-24,3 26 | 2000-01-25,3 27 | 2000-01-26,3 28 | 2000-01-27,3 29 | 2000-01-28,3 30 | 2000-01-29,3 31 | 2000-01-30,3 32 | 2000-01-31,3 33 | 2000-02-01,3 34 | 2000-02-02,3 35 | 2000-02-03,3 36 | 2000-02-04,3 37 | 2000-02-05,3 38 | 2000-02-06,3 39 | 2000-02-07,3 40 | 2000-02-08,3 41 | 2000-02-09,3 42 | 2000-02-10,3 43 | 2000-02-11,3 44 | 2000-02-12,3 45 | 2000-02-13,3 46 | 2000-02-14,3 47 | 2000-02-15,3 48 | -------------------------------------------------------------------------------- /tests/test_datasets/test_data_reordering.csv: -------------------------------------------------------------------------------- 1 | first_column,second_column,third_column 2 | 2020-02-28,11,12 3 | 2020-02-25,2,3 4 | 2020-02-27,8,9 5 | 2020-02-26,5,6 6 | 7 | -------------------------------------------------------------------------------- /tests/utilities.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas 3 | from pandas import DataFrame 4 | 5 | 6 | def get_fake_df(length: int, features: int = 1, name: str = "value") -> DataFrame: 7 | dates = pandas.date_range('1/1/2000', periods=length) 8 | 9 | np.random.seed(0) 10 | df = pandas.DataFrame({f"{name}_{i}": np.random.randn(length) for i in range(0, features)}, 11 | index=dates) 12 | return df 13 | 14 | -------------------------------------------------------------------------------- /timexseries/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | .. include:: ./documentation.md 3 | """ 4 | from math import sqrt 5 | 6 | import numpy as np 7 | import pandas as pd 8 | 9 | from pandas import DataFrame, Series 10 | 11 | 12 | class TimeSeriesContainer: 13 | """ 14 | A TimeSeriesContainer collect all the relevant information useful to characterize a single time-series coming from 15 | the ingested dataset. 16 | 17 | Parameters 18 | ---------- 19 | timeseries_data : DataFrame 20 | Historical time-series data, in the form of a DataFrame with a index and a single data column. 21 | models : dict 22 | Dictionary of ModelResult objects, all trained on this time-series. 23 | xcorr : dict 24 | Cross-correlation between the data of this time-series and all the other ones. 25 | historical_prediction : dict 26 | The historical prediction, i.e. the predictions computed on a rolling window on the historical data. 27 | This is useful to verify the performances of each model not only on the very last data, but throughout the 28 | history of the time-series, in a cross-validation fashion. This dictionary contains one entry for each model 29 | tested, and each of this entry contains two keys: 'series', i.e., the actual historical prediction, and 30 | 'metrics', i.e. validation performances of the historical predictions on real data. 31 | """ 32 | def __init__(self, timeseries_data: DataFrame, models: dict, xcorr: dict, historical_prediction: dict = None): 33 | self.timeseries_data = timeseries_data 34 | self.models = models 35 | self.xcorr = xcorr 36 | self.historical_prediction = historical_prediction 37 | 38 | def set_historical_prediction(self, historical_prediction): 39 | self.historical_prediction = historical_prediction 40 | 41 | 42 | class ValidationPerformance: 43 | """ 44 | Class for the summary of various statistical indexes relative to the performance of a prediction model. 45 | 46 | Parameters 47 | ---------- 48 | first_used_index, optional, default None 49 | Index of the first value used in the time series to generate these results. This is a convenience if you already 50 | know that initial index of the data this performance will refer to. 51 | 52 | Attributes 53 | ---------- 54 | MSE : float 55 | Mean Squared Error. Default 0 56 | RMSE: float 57 | Root Mean Squared Error. Default 0 58 | MAE: float 59 | Mean Absolute Error. Default 0 60 | AM: float 61 | Arithmetic Mean of error. Default 0 62 | SD: float 63 | Standard deviation of error. Default 0 64 | """ 65 | def __init__(self, first_used_index=None): 66 | self.first_used_index = first_used_index 67 | self.MSE = 0 68 | self.RMSE = 0 69 | self.MAE = 0 70 | self.AM = 0 71 | self.SD = 0 72 | 73 | def set_testing_stats(self, actual: Series, predicted: Series): 74 | """ 75 | Set all the statistical indexes according to input data. 76 | 77 | Parameters 78 | ---------- 79 | actual : Series 80 | Actual data stored in a Pandas Series. 81 | predicted : Series 82 | Data predicted by a model, stored in a Pandas Series. 83 | 84 | Examples 85 | -------- 86 | >>> dates = pd.date_range('2000-01-01', periods=5) 87 | >>> ds = pd.DatetimeIndex(dates, freq="D") 88 | >>> actual = np.array([1, 1, 1, 1, 1]) 89 | >>> predicted = np.array([3, 3, 3, 3, 3]) 90 | >>> actual_dataframe = DataFrame(data={"a": actual}, index=ds) 91 | >>> predicted_dataframe = DataFrame(data={"yhat": predicted}, index=ds) 92 | 93 | Calculate the performances. 94 | >>> perf = ValidationPerformance() 95 | >>> perf.set_testing_stats(actual_dataframe['a'], predicted_dataframe['yhat']) 96 | 97 | >>> print(perf.MAE) 98 | 2.0 99 | 100 | >>> print(perf.MSE) 101 | 4.0 102 | """ 103 | self.MSE = np.square(np.subtract(actual,predicted)).mean() 104 | self.MAE = np.abs(np.subtract(actual, predicted)).mean() 105 | 106 | self.RMSE = sqrt(self.MSE) 107 | self.AM = sum([y - yhat for y, yhat in zip(actual, predicted)]) / len(actual) 108 | self.SD = (actual - predicted).std(ddof=0) 109 | 110 | def get_dict(self) -> dict: 111 | """ 112 | Return all the parameters, in a dict. 113 | 114 | Returns 115 | ------- 116 | d : dict 117 | All the statistics, in a dict. 118 | 119 | Examples 120 | -------- 121 | >>> perf = ValidationPerformance() 122 | >>> perf.set_testing_stats(actual_dataframe['a'], predicted_dataframe['yhat']) 123 | >>> perf.get_dict() 124 | {'first_used_index': None, 'MSE': 4.0, 'RMSE': 2.0, 'MAE': 2.0, 'AM': -2.0, 'SD': 0.0} 125 | """ 126 | d = {} 127 | for attribute, value in self.__dict__.items(): 128 | d[attribute] = value 129 | 130 | return d 131 | 132 | 133 | class SingleResult: 134 | """ 135 | Class for the result of a model, trained on a specific training set. 136 | 137 | Parameters 138 | ---------- 139 | prediction : DataFrame 140 | Estimated prediction, using this training set 141 | testing_performances : ValidationPerformance 142 | Testing performance (`timexseries.data_prediction.validation_performances.ValidationPerformance`), on the validation 143 | set, obtained using this training set to train the model. 144 | """ 145 | 146 | def __init__(self, prediction: DataFrame, testing_performances: ValidationPerformance): 147 | self.prediction = prediction 148 | self.testing_performances = testing_performances 149 | 150 | 151 | class ModelResult: 152 | """ 153 | Class for to collect the global results of a model trained on a time-series. 154 | 155 | Parameters 156 | ---------- 157 | results : [SingleResult] 158 | List of all the results obtained using all the possible training set for this model, on the time series. 159 | This is useful to create plots which show how the performance vary changing the training data (e.g. 160 | `timexseries.data_visualization.functions.performance_plot`). 161 | characteristics : dict 162 | Model parameters. This dictionary collects human-readable characteristics of the model, e.g. the used number of 163 | validation points used, the length of the sliding training window, etc. 164 | best_prediction : DataFrame 165 | Prediction obtained using the best training window and _all_ the available points in the time-series. This is 166 | the prediction that users are most likely to want. 167 | """ 168 | 169 | def __init__(self, results: [SingleResult], characteristics: dict, best_prediction: DataFrame): 170 | self.results = results 171 | self.characteristics = characteristics 172 | self.best_prediction = best_prediction 173 | 174 | 175 | -------------------------------------------------------------------------------- /timexseries/data_prediction/__init__.py: -------------------------------------------------------------------------------- 1 | from .. import ValidationPerformance 2 | from .models.predictor import PredictionModel 3 | from .pipeline import create_timeseries_containers, get_result_dict -------------------------------------------------------------------------------- /timexseries/data_prediction/models/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DhiriaDev/TIMEX/767841a830bdc6fafbe1702700b9f80175e357de/timexseries/data_prediction/models/__init__.py -------------------------------------------------------------------------------- /timexseries/data_prediction/models/arima.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | 3 | from pandas import DataFrame 4 | 5 | from statsforecast import StatsForecast 6 | from timexseries.data_prediction import PredictionModel 7 | from statsforecast.models import AutoARIMA 8 | 9 | from timexseries.data_prediction.models.seasonality_estimator import estimate_seasonality 10 | 11 | 12 | class ARIMAModel(PredictionModel): 13 | """ARIMA prediction model.""" 14 | def __init__(self, params: dict, transformation: str = "nonconda e"): 15 | super().__init__(params, name="ARIMA", transformation=transformation) 16 | 17 | def predict(self, train_data: DataFrame, points_to_predict: int, 18 | future_dataframe: DataFrame, extra_regressor: DataFrame = None) -> DataFrame: 19 | freq = train_data.index.freq 20 | 21 | seasonality = estimate_seasonality(train_data) 22 | 23 | train_data.reset_index(inplace=True) 24 | train_data.columns = ['ds', 'y'] 25 | train_data.loc[:, 'unique_id'] = 0 26 | 27 | model = StatsForecast( 28 | df=train_data, 29 | models=[AutoARIMA(approximation=True, season_length=seasonality, 30 | seasonal=seasonality != 1, truncate=3*seasonality if seasonality != 1 else None)], 31 | freq=freq 32 | ) 33 | 34 | with warnings.catch_warnings(): 35 | warnings.simplefilter("ignore") 36 | y_hat_df = model.forecast(points_to_predict).set_index("ds") 37 | 38 | future_dataframe.iloc[-points_to_predict:, 0] = y_hat_df.loc[:, 'AutoARIMA'] 39 | 40 | return future_dataframe 41 | -------------------------------------------------------------------------------- /timexseries/data_prediction/models/exponential_smoothing.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from pandas import DataFrame 4 | from statsforecast import StatsForecast 5 | from statsforecast.models import AutoETS 6 | 7 | from timexseries.data_prediction import PredictionModel 8 | from timexseries.data_prediction.models.seasonality_estimator import estimate_seasonality 9 | 10 | log = logging.getLogger(__name__) 11 | 12 | 13 | class ExponentialSmoothingModel(PredictionModel): 14 | """ 15 | Exponential smoothing prediction model. 16 | This model uses the Holt Winters method and automatic parameters estimation. 17 | """ 18 | 19 | def __init__(self, params: dict, transformation: str = "none"): 20 | super().__init__(params, name="ExponentialSmoothing", transformation=transformation) 21 | 22 | def predict(self, train_data: DataFrame, points_to_predict: int, 23 | future_dataframe: DataFrame, extra_regressors: DataFrame = None) -> DataFrame: 24 | """Overrides PredictionModel.predict()""" 25 | freq = train_data.index.freq 26 | 27 | seasonality = estimate_seasonality(train_data) 28 | 29 | seasonality = min(24, seasonality) 30 | 31 | train_data.reset_index(inplace=True) 32 | train_data.columns = ['ds', 'y'] 33 | train_data.loc[:, 'unique_id'] = 0 34 | 35 | # if seasonality == 1: 36 | # model = 'ZZN' 37 | # else: 38 | # model = 'ZZA' 39 | 40 | model = StatsForecast( 41 | df=train_data, 42 | models=[AutoETS(season_length=seasonality, model='ZZZ')], 43 | freq=freq 44 | ) 45 | 46 | y_hat_df = model.forecast(points_to_predict, level=[95]).set_index("ds") 47 | 48 | future_dataframe.iloc[-points_to_predict:, 0] = y_hat_df.loc[:, 'AutoETS'] 49 | index_to_update = future_dataframe.index[-points_to_predict:] 50 | future_dataframe.loc[index_to_update, 'yhat_upper'] = y_hat_df.loc[:, 'AutoETS-hi-95'] 51 | future_dataframe.loc[index_to_update, 'yhat_lower'] = y_hat_df.loc[:, 'AutoETS-lo-95'] 52 | 53 | return future_dataframe 54 | -------------------------------------------------------------------------------- /timexseries/data_prediction/models/flaml.py: -------------------------------------------------------------------------------- 1 | # import logging 2 | # 3 | # from pandas import DataFrame 4 | # import numpy as np 5 | # from flaml import AutoML 6 | # 7 | # from timexseries.data_prediction import PredictionModel 8 | # log = logging.getLogger(__name__) 9 | # 10 | # 11 | # class FLAMLModel(PredictionModel): 12 | # """ 13 | # FLAML 14 | # """ 15 | # 16 | # def __init__(self, params: dict, transformation: str = "none"): 17 | # super().__init__(params, name="FLAML", transformation=transformation) 18 | # 19 | # self.len_train_set = 0 20 | # self.requested_predictions = 0 21 | # self.train_data = None 22 | # 23 | # def train(self, input_data: DataFrame, extra_regressors: DataFrame = None): 24 | # """Overrides PredictionModel.train()""" 25 | # 26 | # self.len_train_set = len(input_data) 27 | # self.train_data = input_data 28 | # 29 | # def predict(self, future_dataframe: DataFrame, extra_regressors: DataFrame = None) -> DataFrame: 30 | # """Overrides PredictionModel.predict()""" 31 | # requested_prediction = len(future_dataframe) - self.len_train_set 32 | # automl = AutoML() 33 | # settings = { 34 | # # "time_budget": 10, # total running time in seconds 35 | # "metric": 'mae', # primary metric for validation: 'mape' is generally used for forecast tasks 36 | # "task": 'ts_forecast', # task type 37 | # # "log_file_name": 'CO2_forecast.log', # flaml log file 38 | # "eval_method": "auto", # validation method can be chosen from ['auto', 'holdout', 'cv'] 39 | # } 40 | # automl.fit(dataframe=self.train_data.reset_index(), # training data 41 | # label=self.train_data.columns[0], # label column 42 | # period=requested_prediction, # key word argument 'period' must be included for forecast task) 43 | # **settings) 44 | # 45 | # flaml_y_pred = automl.predict(future_dataframe.reset_index().iloc[:, 0].to_frame()) 46 | # future_dataframe.iloc[-requested_prediction:, 0] = flaml_y_pred 47 | # return future_dataframe 48 | # 49 | # 50 | -------------------------------------------------------------------------------- /timexseries/data_prediction/models/linear.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | 3 | import numpy as np 4 | from pandas import DataFrame 5 | from timexseries.data_prediction import PredictionModel 6 | from sklearn.linear_model import LinearRegression 7 | 8 | 9 | class LinearModel(PredictionModel): 10 | """Linear prediction model.""" 11 | def __init__(self, params: dict, transformation: str = "Linear"): 12 | super().__init__(params, name="Linear", transformation=transformation) 13 | 14 | def predict(self, train_data: DataFrame, points_to_predict: int, 15 | future_dataframe: DataFrame, extra_regressor: DataFrame = None) -> DataFrame: 16 | 17 | train_data.reset_index(inplace=True) 18 | train_data.columns = ['ds', 'y'] 19 | 20 | model = LinearRegression() 21 | model.fit(np.arange(1, len(train_data)+1).reshape(-1, 1), train_data.loc[:, 'y']) 22 | 23 | y_hat = model.predict(np.arange(1, points_to_predict+1).reshape(-1, 1)) 24 | 25 | future_dataframe.iloc[-points_to_predict:, 0] = y_hat 26 | 27 | return future_dataframe 28 | -------------------------------------------------------------------------------- /timexseries/data_prediction/models/lstm.py: -------------------------------------------------------------------------------- 1 | # import logging 2 | # 3 | # from pandas import DataFrame 4 | # import numpy as np 5 | # import torch 6 | # import torch.nn as nn 7 | # from sklearn.preprocessing import MinMaxScaler 8 | # 9 | # from timexseries.data_prediction import PredictionModel 10 | # 11 | # log = logging.getLogger(__name__) 12 | # 13 | # 14 | # def split_sequences(df, n_in, n_out, n_features): 15 | # in_out_sequence = [] 16 | # 17 | # for i in range(len(df)): 18 | # # find the end of this pattern 19 | # end_ix = i + n_in 20 | # out_end_ix = end_ix + n_out 21 | # # check if we are beyond the sequence 22 | # if out_end_ix > len(df): 23 | # break 24 | # # gather input and output parts of the pattern 25 | # seq_x = [] 26 | # for j in range(i, end_ix): 27 | # this_x = [] 28 | # for k in range(0, n_features): 29 | # this_x.append(df.iloc[j, k]) 30 | # seq_x.append(this_x) 31 | # 32 | # seq_y = list(df.iloc[end_ix:out_end_ix, 0].values) 33 | # in_out_sequence.append((seq_x, seq_y)) 34 | # return in_out_sequence 35 | # 36 | # 37 | # class LSTM(nn.Module): 38 | # def __init__(self, input_size=1, hidden_layer_size=10): 39 | # super().__init__() 40 | # self.hidden_layer_size = hidden_layer_size 41 | # 42 | # self.lstm = nn.LSTM(input_size, hidden_layer_size, num_layers=1) 43 | # 44 | # self.linear = nn.Linear(hidden_layer_size, 1) 45 | # 46 | # self.hidden_cell = (torch.zeros(1, 1, self.hidden_layer_size), 47 | # torch.zeros(1, 1, self.hidden_layer_size)) 48 | # 49 | # def forward(self, input_seq): 50 | # lstm_out, self.hidden_cell = self.lstm(input_seq.view(len(input_seq), 1, -1), self.hidden_cell) 51 | # predictions = self.linear(lstm_out.view(len(input_seq), -1)) 52 | # return predictions[-1] 53 | # 54 | # 55 | # class LSTMModel(PredictionModel): 56 | # """LSTM prediction model.""" 57 | # def __init__(self, params: dict, transformation: str = "none"): 58 | # super().__init__(params, name="LSTM", transformation=transformation) 59 | # 60 | # def predict(self, train_data: DataFrame, points_to_predict: int, 61 | # future_dataframe: DataFrame, extra_regressors: DataFrame = None) -> DataFrame: 62 | # """Overrides PredictionModel.predict()""" 63 | # if torch.cuda.is_available(): 64 | # dev = "cuda:0" 65 | # else: 66 | # dev = "cpu" 67 | # 68 | # scalers = {} 69 | # 70 | # if extra_regressors is not None: 71 | # # We could apply self.transformation also on the extra regressors. 72 | # # From tests, it looks like it doesn't change much/it worsens the forecasts. 73 | # train_data = train_data.join(extra_regressors) 74 | # n_features = 1 + len(extra_regressors.columns) 75 | # for col in extra_regressors.columns: 76 | # scalers[col] = MinMaxScaler(feature_range=(-1, 1)) 77 | # extra_regressors[col] = scalers[col].fit_transform(extra_regressors[[col]]) 78 | # else: 79 | # n_features = 1 80 | # 81 | # train_data.reset_index(inplace=True) 82 | # column_indices = [0, 1] 83 | # new_names = ['ds', 'y'] 84 | # old_names = train_data.columns[column_indices] 85 | # train_data.rename(columns=dict(zip(old_names, new_names)), inplace=True) 86 | # train_data.set_index('ds', inplace=True) 87 | # 88 | # scalers['y'] = MinMaxScaler(feature_range=(-1, 1)) 89 | # train_data['y'] = scalers['y'].fit_transform(train_data[['y']]) 90 | # 91 | # n_steps_in, n_steps_out = round(len(train_data)/4), 1 92 | # 93 | # train_inout_seq = split_sequences(train_data, n_steps_in, n_steps_out, n_features=n_features) 94 | # 95 | # for i in range(0, len(train_inout_seq)): 96 | # x = np.array(train_inout_seq[i][0], dtype=np.float32) 97 | # y = np.array(train_inout_seq[i][1], dtype=np.float32) 98 | # train_inout_seq[i] = (torch.from_numpy(x), torch.tensor(y)) 99 | # 100 | # model = LSTM(input_size=n_features) 101 | # model.to(dev) 102 | # 103 | # loss_function = nn.L1Loss() 104 | # optimizer = torch.optim.Adam(model.parameters(), lr=0.01) 105 | # 106 | # epochs = 10 107 | # 108 | # for i in range(epochs): 109 | # for seq, labels in train_inout_seq: 110 | # seq = seq.to(dev) 111 | # labels = labels.to(dev) 112 | # optimizer.zero_grad() 113 | # model.hidden_cell = (torch.zeros(1, 1, model.hidden_layer_size).to(dev), 114 | # torch.zeros(1, 1, model.hidden_layer_size).to(dev)) 115 | # 116 | # y_pred = model(seq) 117 | # 118 | # single_loss = loss_function(y_pred, labels) 119 | # single_loss.backward() 120 | # optimizer.step() 121 | # 122 | # values_for_prediction = train_inout_seq[-1][0] 123 | # # self.len_train_set = len(train_data) 124 | # 125 | # if extra_regressors is not None: 126 | # extra_regressors = extra_regressors.iloc[-points_to_predict:].copy() 127 | # 128 | # for col in extra_regressors: 129 | # scalers[col] = MinMaxScaler(feature_range=(-1, 1)) 130 | # extra_regressors[col] = scalers[col].fit_transform(extra_regressors[[col]]) 131 | # 132 | # tensors_to_append = [] 133 | # for i in range(0, points_to_predict): 134 | # val = np.array(extra_regressors.iloc[i, :], dtype=np.float32) 135 | # tensors_to_append.append(torch.tensor(val)) 136 | # 137 | # x_input = values_for_prediction 138 | # x_input = x_input.to(dev) 139 | # model.eval() 140 | # 141 | # for i in range(points_to_predict): 142 | # seq = x_input[i:] 143 | # with torch.no_grad(): 144 | # model.hidden = (torch.zeros(1, 1, model.hidden_layer_size), 145 | # torch.zeros(1, 1, model.hidden_layer_size)) 146 | # result = model(seq) 147 | # if extra_regressors is not None: 148 | # result = torch.cat((result, tensors_to_append[i].to(dev))) 149 | # x_input = torch.cat((x_input, result.view(1, -1))) 150 | # 151 | # results = x_input[-points_to_predict:] 152 | # results = results.to("cpu") 153 | # results = [x[0] for x in results] 154 | # actual_predictions = scalers['y'].inverse_transform(np.array(results).reshape(-1, 1)) 155 | # future_dataframe.iloc[-points_to_predict:, 0] = np.array(actual_predictions).flatten() 156 | # 157 | # return future_dataframe 158 | # 159 | # 160 | -------------------------------------------------------------------------------- /timexseries/data_prediction/models/mockup.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from pandas import DataFrame 4 | 5 | from timexseries.data_prediction import PredictionModel 6 | 7 | log = logging.getLogger(__name__) 8 | 9 | 10 | class MockUpModel(PredictionModel): 11 | """ 12 | Mock up prediction model. Useful for testing purposes. 13 | This model "simulates" a real model by returning a - at least in dimensions - correct dataframe. 14 | This dataframe predicts always 0 is no extra regressors have been given, 1 otherwise. 15 | 16 | This can be useful in tests because it runs in very low time and is useful to understand if higher-level functions 17 | work as intended. 18 | """ 19 | 20 | def __init__(self, params: dict, transformation: str = "none"): 21 | super().__init__(params, name="MockUp", transformation=transformation) 22 | try: 23 | if params["model_parameters"]["mockup_confidence"]: 24 | self.confidence_intervals = True 25 | else: 26 | self.confidence_intervals = False 27 | except KeyError: 28 | self.confidence_intervals = False 29 | 30 | try: 31 | self.forced_predictions = params["model_parameters"]["mockup_forced_predictions"] 32 | except KeyError: 33 | self.forced_predictions = None 34 | 35 | def predict(self, train_data: DataFrame, points_to_predict: int, 36 | future_dataframe: DataFrame, extra_regressors: DataFrame = None) -> DataFrame: 37 | """Overrides PredictionModel.predict()""" 38 | if self.forced_predictions is not None: 39 | initial_index = future_dataframe.index[0] 40 | final_index = future_dataframe.index[-1] 41 | future_dataframe.loc[:, 'yhat'] = self.forced_predictions.loc[initial_index:final_index] 42 | if self.confidence_intervals: 43 | future_dataframe.loc[:, 'yhat_lower'] = self.forced_predictions.loc[initial_index:final_index].apply( 44 | lambda x: x - 0.5 45 | ) 46 | future_dataframe.loc[:, 'yhat_upper'] = self.forced_predictions.loc[initial_index:final_index].apply( 47 | lambda x: x + 0.5 48 | ) 49 | else: 50 | if extra_regressors is None: 51 | v = 0 52 | else: 53 | v = len(extra_regressors.columns) 54 | 55 | future_dataframe.loc[future_dataframe.index[-points_to_predict]:, 'yhat'] = v 56 | if self.confidence_intervals: 57 | future_dataframe.loc[future_dataframe.index[-points_to_predict]:, 'yhat_lower'] = v - 0.5 58 | future_dataframe.loc[future_dataframe.index[-points_to_predict]:, 'yhat_upper'] = v + 0.5 59 | 60 | return future_dataframe.copy() 61 | 62 | 63 | -------------------------------------------------------------------------------- /timexseries/data_prediction/models/neuralprophet.py: -------------------------------------------------------------------------------- 1 | # import logging 2 | # import os 3 | # import warnings 4 | # 5 | # from neuralprophet import NeuralProphet 6 | # import pandas as pd 7 | # from pandas import DataFrame 8 | # 9 | # from timexseries.data_prediction import PredictionModel 10 | # logging.getLogger('nprophet').setLevel(logging.WARNING) 11 | # log = logging.getLogger(__name__) 12 | # 13 | # NeuralProphet.set_log_level("ERROR") 14 | # 15 | # 16 | # class NeuralProphetModel(PredictionModel): 17 | # """Facebook's NeuralProphet prediction model.""" 18 | # 19 | # def __init__(self, params: dict, transformation: str = "none"): 20 | # super().__init__(params, name="NeuralProphet", transformation=transformation) 21 | # 22 | # # Stuff needed to make Prophet shut up during training. 23 | # self.suppress_stdout_stderr = suppress_stdout_stderr 24 | # try: 25 | # self.neuralprophet_parameters = params["model_parameters"]["neuralProphet_parameters"] 26 | # except KeyError: 27 | # self.neuralprophet_parameters = None 28 | # 29 | # def train(self, input_data: DataFrame, extra_regressors: DataFrame = None): 30 | # """Overrides PredictionModel.train()""" 31 | # 32 | # self.neuralprophetmodel = NeuralProphet() 33 | # # if self.neuralprophet_parameters is not None: 34 | # # try: 35 | # # timeseries_name = input_data.columns[0] 36 | # # date_format = self.neuralprophet_parameters["holidays_dataframes"]["date_format"] 37 | # # holidays = pd.read_csv(self.neuralprophet_parameters["holidays_dataframes"][timeseries_name]) 38 | # # holidays.loc[:, "ds"].apply(lambda x: pd.to_datetime(x, format=date_format)) 39 | # # self.neuralprophetmodel = NeuralProphet(holidays=holidays) 40 | # # log.debug(f"Using a dataframe for holidays...") 41 | # # except KeyError: 42 | # # self.neuralprophetmodel = NeuralProphet() 43 | # # 44 | # # try: 45 | # # holiday_country = self.neuralprophet_parameters["holiday_country"] 46 | # # self.neuralprophetmodel.add_country_holidays(country_name=holiday_country) 47 | # # log.debug(f"Set {holiday_country} as country for holiday calendar...") 48 | # # except KeyError: 49 | # # pass 50 | # # 51 | # # else: 52 | # # self.neuralprophetmodel = NeuralProphet() 53 | # 54 | # if extra_regressors is not None: 55 | # # We could apply self.transformation also on the extra regressors. 56 | # # From tests, it looks like it doesn't change much/it worsens the forecasts. 57 | # input_data = input_data.join(extra_regressors) 58 | # input_data.reset_index(inplace=True) 59 | # column_indices = [0, 1] 60 | # new_names = ['ds', 'y'] 61 | # old_names = input_data.columns[column_indices] 62 | # input_data.rename(columns=dict(zip(old_names, new_names)), inplace=True) 63 | # [self.neuralprophetmodel.add_future_regressor(col) for col in extra_regressors.columns] 64 | # 65 | # else: 66 | # input_data.reset_index(inplace=True) 67 | # input_data.columns = ['ds', 'y'] 68 | # 69 | # with self.suppress_stdout_stderr(): 70 | # self.neuralprophetmodel.fit(input_data, self.freq) 71 | # 72 | # self.y = input_data 73 | # 74 | # def predict(self, future_dataframe: DataFrame, extra_regressors: DataFrame = None) -> DataFrame: 75 | # """Overrides PredictionModel.predict()""" 76 | # requested_prediction = len(future_dataframe) - len(self.y) 77 | # 78 | # if extra_regressors is not None: 79 | # extra_regressors = extra_regressors.iloc[-requested_prediction:, :] 80 | # extra_regressors = extra_regressors.reset_index() 81 | # extra_regressors = extra_regressors.drop(columns=["index"]) 82 | # 83 | # future = self.neuralprophetmodel.make_future_dataframe(self.y, periods=requested_prediction, 84 | # n_historic_predictions=len(self.y), 85 | # regressors_df=extra_regressors) 86 | # 87 | # with self.suppress_stdout_stderr(): 88 | # forecast = self.neuralprophetmodel.predict(future) 89 | # 90 | # forecast = forecast.rename(columns={"yhat1": "yhat"}) 91 | # forecast.set_index('ds', inplace=True) 92 | # 93 | # return forecast 94 | # 95 | # 96 | # class suppress_stdout_stderr(object): 97 | # """ 98 | # A context manager for doing a "deep suppression" of stdout and stderr in 99 | # Python, i.e. will suppress all print, even if the print originates in a 100 | # compiled C/Fortran sub-function. 101 | # This will not suppress raised exceptions, since exceptions are printed 102 | # to stderr just before a script exits, and after the context manager has 103 | # exited (at least, I think that is why it lets exceptions through). 104 | # 105 | # """ 106 | # 107 | # def __init__(self): 108 | # # Open a pair of null files 109 | # self.null_fds = [os.open(os.devnull, os.O_RDWR) for x in range(2)] 110 | # # Save the actual stdout (1) and stderr (2) file descriptors. 111 | # self.save_fds = [os.dup(1), os.dup(2)] 112 | # 113 | # def __enter__(self): 114 | # # Assign the null pointers to stdout and stderr. 115 | # os.dup2(self.null_fds[0], 1) 116 | # os.dup2(self.null_fds[1], 2) 117 | # 118 | # def __exit__(self, *_): 119 | # # Re-assign the real stdout/stderr back to (1) and (2) 120 | # os.dup2(self.save_fds[0], 1) 121 | # os.dup2(self.save_fds[1], 2) 122 | # # Close the null files 123 | # for fd in self.null_fds + self.save_fds: 124 | # os.close(fd) 125 | -------------------------------------------------------------------------------- /timexseries/data_prediction/models/persistence.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from pandas import DataFrame 4 | 5 | from timexseries.data_prediction import PredictionModel 6 | 7 | log = logging.getLogger(__name__) 8 | 9 | 10 | class PersistenceModel(PredictionModel): 11 | """ 12 | Persistence model predictor (also called *naive* model). 13 | Its prediction is to use the last known value. 14 | """ 15 | 16 | def __init__(self, params: dict, transformation: str = "none"): 17 | super().__init__(params, name="Persistence", transformation=transformation) 18 | 19 | def predict(self, train_data: DataFrame, points_to_predict: int, 20 | future_dataframe: DataFrame, extra_regressors: DataFrame = None) -> DataFrame: 21 | """Overrides PredictionModel.predict()""" 22 | future_dataframe.iloc[-points_to_predict:, 0] = train_data.iloc[-1, 0] 23 | return future_dataframe 24 | -------------------------------------------------------------------------------- /timexseries/data_prediction/models/prophet.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import os 3 | 4 | from prophet import Prophet 5 | import pandas as pd 6 | from pandas import DataFrame 7 | 8 | from timexseries.data_prediction import PredictionModel 9 | 10 | logging.getLogger('prophet').setLevel(logging.WARNING) 11 | stanpy_logger = logging.getLogger('cmdstanpy') 12 | stanpy_logger.addHandler(logging.NullHandler()) 13 | stanpy_logger.propagate = False 14 | stanpy_logger.setLevel(logging.CRITICAL) 15 | 16 | log = logging.getLogger(__name__) 17 | 18 | 19 | class FBProphetModel(PredictionModel): 20 | """Facebook's Prophet prediction model.""" 21 | 22 | def __init__(self, params: dict, transformation: str = "none"): 23 | super().__init__(params, name="FBProphet", transformation=transformation) 24 | 25 | # Stuff needed to make Prophet shut up during training. 26 | self.suppress_stdout_stderr = suppress_stdout_stderr 27 | fbmodel = Prophet() 28 | try: 29 | self.fbprophet_parameters = params["model_parameters"]["fbprophet_parameters"] 30 | except KeyError: 31 | self.fbprophet_parameters = None 32 | 33 | def predict(self, input_data: DataFrame, points_to_predict: int, future_dataframe: DataFrame, 34 | extra_regressors: DataFrame = None): 35 | """Overrides PredictionModel.predict()""" 36 | 37 | if self.fbprophet_parameters is not None: 38 | try: 39 | timeseries_name = input_data.columns[0] 40 | date_format = self.fbprophet_parameters["holidays_dataframes"]["date_format"] 41 | holidays = pd.read_csv(self.fbprophet_parameters["holidays_dataframes"][timeseries_name]) 42 | holidays.loc[:, "ds"].apply(lambda x: pd.to_datetime(x, format=date_format)) 43 | fbmodel = Prophet(holidays=holidays) 44 | log.debug(f"Using a dataframe for holidays...") 45 | except KeyError: 46 | fbmodel = Prophet() 47 | 48 | try: 49 | holiday_country = self.fbprophet_parameters["holiday_country"] 50 | fbmodel.add_country_holidays(country_name=holiday_country) 51 | log.debug(f"Set {holiday_country} as country for holiday calendar...") 52 | except KeyError: 53 | pass 54 | 55 | else: 56 | fbmodel = Prophet() 57 | 58 | if extra_regressors is not None: 59 | # We could apply self.transformation also on the extra regressors. 60 | # From tests, it looks like it doesn't change much/it worsens the forecasts. 61 | input_data = input_data.join(extra_regressors) 62 | input_data.reset_index(inplace=True) 63 | column_indices = [0, 1] 64 | new_names = ['ds', 'y'] 65 | old_names = input_data.columns[column_indices] 66 | input_data.rename(columns=dict(zip(old_names, new_names)), inplace=True) 67 | [fbmodel.add_regressor(col) for col in extra_regressors.columns] 68 | 69 | else: 70 | input_data.reset_index(inplace=True) 71 | input_data.columns = ['ds', 'y'] 72 | 73 | with self.suppress_stdout_stderr(): 74 | fbmodel.fit(input_data) 75 | 76 | future = future_dataframe.reset_index() 77 | future.rename(columns={'index': 'ds'}, inplace=True) 78 | 79 | if extra_regressors is not None: 80 | future.set_index('ds', inplace=True) 81 | future = future.join(extra_regressors.copy()) 82 | future.reset_index(inplace=True) 83 | 84 | forecast = fbmodel.predict(future) 85 | 86 | forecast.set_index('ds', inplace=True) 87 | 88 | return forecast 89 | 90 | 91 | class suppress_stdout_stderr(object): 92 | """ 93 | A context manager for doing a "deep suppression" of stdout and stderr in 94 | Python, i.e. will suppress all print, even if the print originates in a 95 | compiled C/Fortran sub-function. 96 | This will not suppress raised exceptions, since exceptions are printed 97 | to stderr just before a script exits, and after the context manager has 98 | exited (at least, I think that is why it lets exceptions through). 99 | 100 | """ 101 | 102 | def __init__(self): 103 | # Open a pair of null files 104 | self.null_fds = [os.open(os.devnull, os.O_RDWR) for x in range(2)] 105 | # Save the actual stdout (1) and stderr (2) file descriptors. 106 | self.save_fds = [os.dup(1), os.dup(2)] 107 | 108 | def __enter__(self): 109 | # Assign the null pointers to stdout and stderr. 110 | os.dup2(self.null_fds[0], 1) 111 | os.dup2(self.null_fds[1], 2) 112 | 113 | def __exit__(self, *_): 114 | # Re-assign the real stdout/stderr back to (1) and (2) 115 | os.dup2(self.save_fds[0], 1) 116 | os.dup2(self.save_fds[1], 2) 117 | # Close the null files 118 | for fd in self.null_fds + self.save_fds: 119 | os.close(fd) 120 | -------------------------------------------------------------------------------- /timexseries/data_prediction/models/random_walk_with_drift.py: -------------------------------------------------------------------------------- 1 | from pandas import DataFrame 2 | 3 | from statsforecast import StatsForecast 4 | from timexseries.data_prediction import PredictionModel 5 | from statsforecast.models import AutoARIMA, SeasonalNaive, RandomWalkWithDrift 6 | 7 | from timexseries.data_prediction.models.seasonality_estimator import estimate_seasonality 8 | 9 | 10 | class RandomWalkWithDriftModel(PredictionModel): 11 | """Random walk with drift prediction model.""" 12 | def __init__(self, params: dict, transformation: str = "none"): 13 | super().__init__(params, name="Random walk with drift", transformation=transformation) 14 | 15 | def predict(self, train_data: DataFrame, points_to_predict: int, 16 | future_dataframe: DataFrame, extra_regressor: DataFrame = None) -> DataFrame: 17 | freq = train_data.index.freq 18 | 19 | train_data.reset_index(inplace=True) 20 | train_data.columns = ['ds', 'y'] 21 | train_data.loc[:, 'unique_id'] = 0 22 | 23 | model = StatsForecast( 24 | df=train_data, 25 | models=[RandomWalkWithDrift()], 26 | freq=freq 27 | ) 28 | 29 | y_hat_df = model.forecast(points_to_predict, level=[95]).set_index("ds") 30 | future_dataframe.iloc[-points_to_predict:, 0] = y_hat_df.loc[:, 'RWD'] 31 | index_to_update = future_dataframe.index[-points_to_predict:] 32 | future_dataframe.loc[index_to_update, 'yhat_upper'] = y_hat_df.loc[:, 'RWD-hi-95'] 33 | future_dataframe.loc[index_to_update, 'yhat_lower'] = y_hat_df.loc[:, 'RWD-lo-95'] 34 | 35 | return future_dataframe 36 | -------------------------------------------------------------------------------- /timexseries/data_prediction/models/seasonal_persistence.py: -------------------------------------------------------------------------------- 1 | from pandas import DataFrame 2 | 3 | from statsforecast import StatsForecast 4 | from timexseries.data_prediction import PredictionModel 5 | from statsforecast.models import SeasonalNaive 6 | 7 | from timexseries.data_prediction.models.seasonality_estimator import estimate_seasonality 8 | 9 | 10 | class SeasonalPersistenceModel(PredictionModel): 11 | """Seasonal persistence (naive) prediction model.""" 12 | def __init__(self, params: dict, transformation: str = "none"): 13 | super().__init__(params, name="Seasonal persistence", transformation=transformation) 14 | 15 | def predict(self, train_data: DataFrame, points_to_predict: int, 16 | future_dataframe: DataFrame, extra_regressor: DataFrame = None) -> DataFrame: 17 | freq = train_data.index.freq 18 | 19 | seasonality = estimate_seasonality(train_data) 20 | 21 | train_data.reset_index(inplace=True) 22 | train_data.columns = ['ds', 'y'] 23 | train_data.loc[:, 'unique_id'] = 0 24 | 25 | model = StatsForecast( 26 | df=train_data, 27 | models=[SeasonalNaive(season_length=seasonality)], 28 | freq=freq 29 | ) 30 | 31 | y_hat_df = model.forecast(points_to_predict, level=[95]).set_index("ds") 32 | 33 | future_dataframe.iloc[-points_to_predict:, 0] = y_hat_df.loc[:, 'SeasonalNaive'] 34 | index_to_update = future_dataframe.index[-points_to_predict:] 35 | future_dataframe.loc[index_to_update, 'yhat_upper'] = y_hat_df.loc[:, 'SeasonalNaive-hi-95'] 36 | future_dataframe.loc[index_to_update, 'yhat_lower'] = y_hat_df.loc[:, 'SeasonalNaive-lo-95'] 37 | 38 | return future_dataframe 39 | -------------------------------------------------------------------------------- /timexseries/data_prediction/models/seasonality_estimator.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import statsmodels.api as sm 3 | import numpy as np 4 | 5 | 6 | def estimate_seasonality(series: pd.DataFrame): 7 | """ 8 | Estimate seasonality in a time-series. 9 | Returns seasonality period. Returns 1 if no seasonality is found. 10 | """ 11 | 12 | maxnlags = min(30, int(len(series)/2)-1) 13 | 14 | s = pd.Series(sm.tsa.pacf(series, method='ywm', nlags=maxnlags)) 15 | s = np.abs(s) 16 | 17 | s[0] = 0 18 | s[1] = 0 19 | 20 | s = s[s > 2.58 / np.sqrt(len(series))].sort_values(ascending=False) 21 | 22 | if len(s) > 0: 23 | seasonality = s.index[0] - 1 24 | else: 25 | seasonality = 1 26 | 27 | return seasonality 28 | -------------------------------------------------------------------------------- /timexseries/data_prediction/transformation.py: -------------------------------------------------------------------------------- 1 | from pandas import Series 2 | import numpy as np 3 | from scipy.stats import yeojohnson 4 | 5 | 6 | class Transformation: 7 | """ 8 | Super-class used to represent various types of data transformation. 9 | """ 10 | 11 | def apply(self, data: Series) -> Series: 12 | """ 13 | Apply the transformation on each value in a Pandas Series. Returns the transformed Series, i.e. a Series with 14 | transformed values. 15 | 16 | Note that it is not guaranteed that the dtype of the returned Series is the same of `data`. 17 | 18 | Parameters 19 | ---------- 20 | data : Series 21 | Data to transform. 22 | 23 | Returns 24 | ------- 25 | Series 26 | Transformed data. 27 | """ 28 | pass 29 | 30 | def inverse(self, data: Series) -> Series: 31 | """ 32 | Apply the inverse of the transformation on the values of a Pandas Series of transformed values. 33 | Returns the data re-transformed back to the real world. 34 | 35 | Any class implementing Transformation should make the `inverse` method always return a Series with the same 36 | shape as the one of `data`. If the function is not invertible (e.g. Log), the returning values should be 37 | approximated. It is assumed in the rest of TIMEX that `inverse` does not fail. 38 | 39 | Parameters 40 | ---------- 41 | data : Series 42 | Data to transform. 43 | 44 | Returns 45 | ------- 46 | Series 47 | Transformed data. 48 | """ 49 | pass 50 | 51 | 52 | class Log(Transformation): 53 | """Class corresponding to a somewhat classic logarithmic feature transformation. 54 | 55 | Notes 56 | ----- 57 | The actual function computed by this transformation is: 58 | 59 | .. math:: 60 | f(x) = sign(x) * log(|x|) 61 | 62 | if `x` > 1, 0 otherwise. 63 | 64 | Note that this way time-series which contain 0 values will have its values modified, because `inverse` will return 65 | 1 instead of 0 when returning the transformed time-series to the real world. 66 | 67 | The inverse function, indeed, is: 68 | 69 | .. math:: 70 | f^{-1}(x) = sign(x) * e^{abs(x)} 71 | 72 | LogModified should be preferred. 73 | """ 74 | def apply(self, data: Series) -> Series: 75 | return data.apply(lambda x: np.sign(x) * np.log(abs(x)) if abs(x) > 1 else 0) 76 | 77 | def inverse(self, data: Series) -> Series: 78 | return data.apply(lambda x: np.sign(x) * np.exp(abs(x))) 79 | 80 | def __str__(self): 81 | return "Log" 82 | 83 | 84 | class LogModified(Transformation): 85 | """Class corresponding to the a custom variant of logarithmic feature transformation. 86 | In particular, this transformation tries to overcome the traditional issues of a logarithmic transformation, i.e. 87 | the impossibility to work on negative data and the different behaviour on 0 < x < 1. 88 | 89 | Notes 90 | ----- 91 | The actual function computed by this transformation is: 92 | 93 | .. math:: 94 | f(x) = sign(x) * log(|x| + 1) 95 | 96 | The inverse, instead, is: 97 | 98 | .. math:: 99 | f^{-1}(x) = sign(x) * e^{(abs(x) - sign(x))} 100 | """ 101 | def apply(self, data: Series) -> Series: 102 | return data.apply(lambda x: np.sign(x) * np.log(abs(x) + 1)) 103 | 104 | def inverse(self, data: Series) -> Series: 105 | return data.apply(lambda x: np.sign(x) * np.exp(abs(x)) - np.sign(x)) 106 | 107 | def __str__(self): 108 | return "modified Log" 109 | 110 | 111 | class Identity(Transformation): 112 | """Class corresponding to the identity transformation. 113 | This is useful because the absence of a data pre-processing transformation would be a particular case for functions 114 | which compute predictions; instead, using this, that case is not special anymore. 115 | 116 | Notes 117 | ----- 118 | The actual function computed by this transformation is: 119 | 120 | .. math:: 121 | f(x) = x 122 | 123 | The inverse, instead, is: 124 | 125 | .. math:: 126 | f^{-1}(x) = x 127 | """ 128 | def apply(self, data: Series) -> Series: 129 | return data 130 | 131 | def inverse(self, data: Series) -> Series: 132 | return data 133 | 134 | def __str__(self): 135 | return "none" 136 | 137 | 138 | class YeoJohnson(Transformation): 139 | """Class corresponding to the Yeo-Johnson transformation. 140 | 141 | Notes 142 | ----- 143 | Introduced in [^1], this transformation tries to make the input data more stable. 144 | 145 | Warnings 146 | -------- 147 | .. warning:: Yeo-Johnson is basically broken for some series with high values. 148 | Follow this issue: https://github.com/scikit-learn/scikit-learn/issues/14959 149 | Until this is solved, Yeo-Johnson may not work as expected and create random crashes. 150 | 151 | References 152 | ---------- 153 | [^1]: Yeo, I. K., & Johnson, R. A. (2000). A new family of power transformations to improve normality or symmetry. 154 | Biometrika, 87(4), 954-959. https://doi.org/10.1093/biomet/87.4.954 155 | """ 156 | 157 | def __init__(self): 158 | self.lmbda = 0 159 | 160 | def apply(self, data: Series) -> Series: 161 | ind = data.index 162 | res, lmbda = yeojohnson(data) 163 | self.lmbda = lmbda 164 | return Series(res, index=ind) 165 | 166 | def inverse(self, data: Series) -> Series: 167 | ind = data.index 168 | lmbda = self.lmbda 169 | x_inv = np.zeros_like(data) 170 | pos = data >= 0 171 | 172 | # when x >= 0 173 | if abs(lmbda) < np.spacing(1.): 174 | x_inv[pos] = np.exp(data[pos]) - 1 175 | else: # lmbda != 0 176 | x_inv[pos] = np.power(data[pos] * lmbda + 1, 1 / lmbda) - 1 177 | 178 | # when x < 0 179 | if abs(lmbda - 2) > np.spacing(1.): 180 | x_inv[~pos] = 1 - np.power(-(2 - lmbda) * data[~pos] + 1, 181 | 1 / (2 - lmbda)) 182 | else: # lmbda == 2 183 | x_inv[~pos] = 1 - np.exp(-data[~pos]) 184 | 185 | return Series(x_inv, index=ind) 186 | 187 | def __str__(self): 188 | return f"Yeo-Johnson (lambda: {round(self.lmbda, 3)})" 189 | 190 | 191 | class Diff(Transformation): 192 | """Class corresponding to the differentiate transformation. 193 | Basically, each value at time `t` is computed as the difference between the current value and the past one. 194 | Applying this transformation makes the transformed Series have one less value, because the first one can not be 195 | computed; the value is saved in order to be able to recompute `inverse`. 196 | 197 | Notes 198 | ----- 199 | Let `X` be the time-series and `X(t)` the value of the time-series at time `t`. This transformation changes X in Y, 200 | where: 201 | 202 | .. math:: 203 | Y(t) = X(t) - X(t-1) 204 | """ 205 | def __init__(self): 206 | self.first_value = 0 207 | 208 | def apply(self, data: Series) -> Series: 209 | self.first_value = data[0] 210 | return data.diff()[1:] 211 | 212 | def inverse(self, data: Series) -> Series: 213 | return Series(np.r_[self.first_value, data].cumsum()) 214 | 215 | def __str__(self): 216 | return "differentiate (1)" 217 | 218 | 219 | def transformation_factory(tr_class: str) -> Transformation: 220 | """ 221 | Given the type of the transformation, encoded as string, return the Transformation object. 222 | 223 | Parameters 224 | ---------- 225 | tr_class : str 226 | Transformation type. 227 | 228 | Returns 229 | ------- 230 | Transformation 231 | Transformation object. 232 | 233 | Examples 234 | -------- 235 | Create a Pandas Series and apply the logarithmic transformation: 236 | 237 | >>> x = Series([2, 3, 4, 5]) 238 | >>> tr = transformation_factory("log") 239 | >>> tr_x = tr.apply(x) 240 | >>> tr_x 241 | 0 0.693147 242 | 1 1.098612 243 | 2 1.386294 244 | 3 1.609438 245 | dtype: float64 246 | 247 | Now, let's compute the inverse transformation which should return the data to the real world: 248 | 249 | >>> inv_tr_x = tr.inverse(tr_x) 250 | >>> inv_tr_x 251 | 0 2.0 252 | 1 3.0 253 | 2 4.0 254 | 3 5.0 255 | dtype: float64 256 | """ 257 | if tr_class == "log": 258 | return Log() 259 | elif tr_class == "log_modified": 260 | return LogModified() 261 | elif tr_class == "none": 262 | return Identity() 263 | elif tr_class == "diff": 264 | return Diff() 265 | elif tr_class == "yeo_johnson": 266 | return YeoJohnson() 267 | -------------------------------------------------------------------------------- /timexseries/data_prediction/xcorr.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | from pandas import DataFrame 4 | from statsmodels.tsa.stattools import grangercausalitytests 5 | 6 | 7 | def calc_xcorr(target: str, ingested_data: DataFrame, max_lags: int, modes: [str] = ["pearson"]) -> dict: 8 | """ 9 | Calculate the cross-correlation for the `ingested data`. 10 | Use `target` time-series column as target; the correlation is computed against all lags of all the other columns 11 | which include numbers. NaN values, introduced by the various shifts, are replaced with 0. 12 | 13 | Parameters 14 | ---------- 15 | target : str 16 | Column which is used as target for the cross correlation. 17 | 18 | ingested_data : DataFrame 19 | DataFrame which contains the various time-series, one for column. 20 | 21 | max_lags : int 22 | Limit the analysis to max lags. 23 | 24 | modes : [str] 25 | Cross-correlation can be computed with different algorithms. The available choices are: 26 | 27 | - `matlab_normalized`: same as using the MatLab function xcorr(x, y, 'normalized') 28 | - `pearson` : use Pearson formula (NaN values are fillled to 0) 29 | - `kendall`: use Kendall formula (NaN values are filled to 0) 30 | - `spearman`: use Spearman formula (NaN values are filled to 0) 31 | 32 | Returns 33 | ------- 34 | result : dict 35 | Dictionary with a Pandas DataFrame set for every indicated mode. 36 | Each DataFrame has the lags as index and the correlation value for each column. 37 | 38 | Examples 39 | -------- 40 | Create some sample time-series. 41 | >>> dates = pd.date_range('2000-01-01', periods=30) # Last index is 2000-01-30 42 | >>> ds = pd.DatetimeIndex(dates, freq="D") 43 | >>> 44 | >>> x = np.linspace(0, 2 * np.pi, 60) 45 | >>> y = np.sin(x) 46 | >>> 47 | >>> np.random.seed(0) 48 | >>> noise = np.random.normal(0, 2.0, 60) 49 | >>> y = y + noise 50 | >>> 51 | >>> a = y[:30] 52 | >>> b = y[5:35] 53 | >>> 54 | >>> timeseries_dataframe = DataFrame(data={"a": a, "b": b}, index=ds) 55 | 56 | Compute the cross-correlation: 57 | >>> calc_xcorr("a", timeseries_dataframe, 7, ["pearson"]) 58 | {'pearson': b 59 | -7 0.316213 60 | -6 -0.022288 61 | -5 0.112483 62 | -4 -0.268724 63 | -3 0.105511 64 | -2 0.178658 65 | -1 0.101505 66 | 0 0.051641 67 | 1 -0.360475 68 | 2 -0.074952 69 | 3 -0.047689 70 | 4 -0.252324 71 | 5 0.796120 72 | 6 -0.170558 73 | 7 -0.009305 74 | } 75 | 76 | This is expected; the biggest value of cross-correlation is at index `5`. It is true that `b` is exactly time-series 77 | `a`, but shifted forward of `5` lags. 78 | """ 79 | 80 | def df_shifted(df, _target=None, lag=0): 81 | if not lag and not _target: 82 | return df 83 | new = {} 84 | for c in df.columns: 85 | if c == _target: 86 | new[c] = df[_target] 87 | else: 88 | new[c] = df[c].shift(periods=lag) 89 | return pd.DataFrame(data=new) 90 | 91 | columns = ingested_data.columns.tolist() 92 | columns = [elem for elem in columns if ingested_data[elem].dtype != str and elem != target] 93 | 94 | results = {} 95 | for mode in modes: 96 | result = DataFrame(columns=columns, dtype=np.float64) 97 | if mode == 'matlab_normalized': 98 | lags_to_displace = max_lags if max_lags < len(ingested_data) else len(ingested_data) - 1 99 | for col in columns: 100 | x = ingested_data[target] 101 | y = ingested_data[col] 102 | 103 | c = np.correlate(x, y, mode="full") 104 | 105 | # This is needed to obtain the same result of the MatLab `xcorr` function with normalized results. 106 | # You can find the formula in the function pyplot.xcorr; however, here the property 107 | # sqrt(x*y) = sqrt(x) * sqrt(y) 108 | # is applied in order to avoid overflows if the ingested values are particularly high. 109 | den = np.sqrt(np.dot(x, x)) * np.sqrt(np.dot(y, y)) 110 | c = np.divide(c, den) 111 | 112 | # This assigns the correct indexes to the results. 113 | if len(ingested_data) > max_lags: 114 | c = c[len(ingested_data) - 1 - max_lags:len(ingested_data) + max_lags] 115 | 116 | result[col] = c 117 | 118 | result.index -= lags_to_displace 119 | 120 | elif mode == 'granger': 121 | for col in columns: 122 | granger_max_lags = int(len(ingested_data) / 3) - 1 123 | granger_max_lags = granger_max_lags if granger_max_lags < max_lags else max_lags 124 | 125 | # Trick to compute both negative and positive lags 126 | df = ingested_data[[col, target]] 127 | granger_result = grangercausalitytests(df, maxlag=granger_max_lags, verbose=False) 128 | for i in granger_result: 129 | result.loc[-i, col] = 1 - granger_result[i][0]['params_ftest'][1] 130 | 131 | df = ingested_data[[target, col]] 132 | granger_result = grangercausalitytests(df, maxlag=granger_max_lags, verbose=False) 133 | for i in granger_result: 134 | result.loc[i, col] = 1 - granger_result[i][0]['params_ftest'][1] 135 | 136 | result.sort_index(inplace=True) 137 | 138 | else: 139 | lags_to_displace = max_lags if max_lags < len(ingested_data) else len(ingested_data) 140 | for i in range(-lags_to_displace, lags_to_displace + 1): 141 | shifted = df_shifted(ingested_data, target, i) 142 | shifted.fillna(0, inplace=True) 143 | 144 | corr = [shifted[target].corr(other=shifted[col], method=mode) for col in columns] 145 | result.loc[i] = corr 146 | 147 | results[mode] = result 148 | 149 | return results 150 | 151 | 152 | def calc_all_xcorr(ingested_data: DataFrame, param_config: dict) -> dict: 153 | """ 154 | Compute, for every column in `ingested_data` (excluding the index) the cross-correlation of that series with respect 155 | to all others columns in ingested data. 156 | 157 | Parameters 158 | ---------- 159 | ingested_data : DataFrame 160 | Pandas DataFrame for which the cross-correlation of all columns should be computed. 161 | 162 | param_config : dict 163 | TIMEX configuration dictionary, needed to for `xcorr_parameters`. 164 | In the `xcorr_parameters` sub-dictionary, `xcorr_modes` and `xcorr_max_lags` will be used. 165 | `xcorr_modes` indicate the different algorithms which should be used to compute the cross-correlation. 166 | The available choices are: 167 | 168 | - `matlab_normalized`: same as using the MatLab function xcorr(x, y, 'normalized') 169 | - `pearson` : use Pearson formula (NaN values are fillled to 0) 170 | - `kendall`: use Kendall formula (NaN values are filled to 0) 171 | - `spearman`: use Spearman formula (NaN values are filled to 0) 172 | 173 | `xcorr_max_lags` is the number of lags, both in positive and negative direction, to which the cross-correlation 174 | calculations should be limited to. 175 | 176 | Returns 177 | ------- 178 | dict 179 | Python dict with a key for every time-series in `ingested_data`; every key will correspond to another dictionary 180 | with one entry for each cross-correlation algorithm requested. 181 | 182 | Examples 183 | -------- 184 | Create sample data. 185 | >>> dates = pd.date_range('2000-01-01', periods=30) # Last index is 2000-01-30 186 | >>> ds = pd.DatetimeIndex(dates, freq="D") 187 | >>> 188 | >>> x = np.linspace(0, 2 * np.pi, 60) 189 | >>> y = np.sin(x) 190 | >>> np.random.seed(0) 191 | >>> noise = np.random.normal(0, 2.0, 60) 192 | >>> y = y + noise 193 | >>> 194 | >>> a = y[:30] 195 | >>> b = y[2:32] 196 | >>> c = y[4:34] 197 | >>> 198 | >>> timeseries_dataframe = DataFrame(data={"a": a, "b": b, "c": c}, index=ds) 199 | 200 | Compute the cross-correlation on this DataFrame: 201 | >>> param_config = { 202 | >>> "xcorr_parameters": { 203 | >>> "xcorr_max_lags": 2, 204 | >>> "xcorr_mode": "pearson,matlab_normalized" 205 | >>> } 206 | >>> } 207 | >>> calc_all_xcorr(timeseries_dataframe, param_config) 208 | {'a': {'pearson': b c 209 | -2 -0.252086 0.117286 210 | -1 0.006370 0.064624 211 | 0 -0.011866 -0.290049 212 | 1 -0.115114 -0.091762 213 | 2 0.951782 -0.024158, 214 | 'matlab_normalized': b c 215 | -2 0.109634 0.287681 216 | -1 0.314318 0.239430 217 | 0 0.319016 0.008663 218 | 1 0.244525 0.197663 219 | 2 0.965095 0.260254}, 220 | 221 | 'b': {'pearson': a c 222 | -2 0.998491 -0.353341 223 | -1 -0.085531 -0.007476 224 | 0 -0.011866 0.048841 225 | 1 0.013242 -0.092448 226 | 2 -0.258411 0.895226, 227 | 'matlab_normalized': a c 228 | -2 0.965095 -0.063331 229 | -1 0.244525 0.177921 230 | 0 0.319016 0.252201 231 | 1 0.314318 0.183260 232 | 2 0.109634 0.862899}, 233 | 234 | 'c': {'pearson': a b 235 | -2 0.076014 0.929572 236 | -1 -0.013978 -0.026488 237 | 0 -0.290049 0.048841 238 | 1 0.038452 -0.043913 239 | 2 0.125275 -0.354749, 240 | 'matlab_normalized': a b 241 | -2 0.260254 0.862899 242 | -1 0.197663 0.183260 243 | 0 0.008663 0.252201 244 | 1 0.239430 0.177921 245 | 2 0.287681 -0.063331}} 246 | """ 247 | xcorr_max_lags = param_config['xcorr_parameters']['xcorr_max_lags'] 248 | xcorr_modes = [*param_config['xcorr_parameters']["xcorr_mode"].split(",")] 249 | d = {} 250 | for col in ingested_data.columns: 251 | d[col] = calc_xcorr(col, ingested_data, max_lags=xcorr_max_lags, modes=xcorr_modes) 252 | 253 | return d -------------------------------------------------------------------------------- /timexseries/data_visualization/__init__.py: -------------------------------------------------------------------------------- 1 | from .functions import create_timeseries_dash_children -------------------------------------------------------------------------------- /timexseries/data_visualization/locales/base.pot: -------------------------------------------------------------------------------- 1 | # Translations template for PROJECT. 2 | # Copyright (C) 2022 ORGANIZATION 3 | # This file is distributed under the same license as the PROJECT project. 4 | # FIRST AUTHOR , 2022. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PROJECT VERSION\n" 10 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" 11 | "POT-Creation-Date: 2022-07-26 18:41+0200\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=utf-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Generated-By: Babel 2.10.3\n" 19 | 20 | #: functions.py:99 21 | msgid " analysis" 22 | msgstr "" 23 | 24 | #: functions.py:100 25 | msgid "Data visualization" 26 | msgstr "" 27 | 28 | #: functions.py:115 29 | msgid "Cross-correlation" 30 | msgstr "" 31 | 32 | #: functions.py:116 33 | msgid "" 34 | "Negative lags (left part) show the correlation between this scenario and " 35 | "the future of the others." 36 | msgstr "" 37 | 38 | #: functions.py:118 39 | msgid "" 40 | "Meanwhile, positive lags (right part) shows the correlation between this " 41 | "scenario and the past of the others." 42 | msgstr "" 43 | 44 | #: functions.py:121 45 | msgid "" 46 | "The peaks found using each cross-correlation modality are shown in the " 47 | "graphs:" 48 | msgstr "" 49 | 50 | #: functions.py:132 51 | msgid "Training & Validation results" 52 | msgstr "" 53 | 54 | #: functions.py:162 55 | msgid "Prediction" 56 | msgstr "" 57 | 58 | #: functions.py:163 59 | msgid "For every model the best predictions for each past date are plotted." 60 | msgstr "" 61 | 62 | #: functions.py:221 functions.py:249 63 | msgid "Line plot" 64 | msgstr "" 65 | 66 | #: functions.py:287 67 | msgid "Histogram" 68 | msgstr "" 69 | 70 | #: functions.py:287 functions.py:689 functions.py:783 71 | msgid "Count" 72 | msgstr "" 73 | 74 | #: functions.py:319 75 | msgid "Trend" 76 | msgstr "" 77 | 78 | #: functions.py:319 79 | msgid "Seasonality" 80 | msgstr "" 81 | 82 | #: functions.py:319 83 | msgid "Residual" 84 | msgstr "" 85 | 86 | #: functions.py:353 87 | msgid "Components decomposition" 88 | msgstr "" 89 | 90 | #: functions.py:353 91 | msgid "Decomposition model" 92 | msgstr "" 93 | 94 | #: functions.py:354 95 | msgid "Additive" 96 | msgstr "" 97 | 98 | #: functions.py:355 99 | msgid "Multiplicative" 100 | msgstr "" 101 | 102 | #: functions.py:361 103 | msgid "" 104 | "Multiplicative model is not available for series which contain zero or " 105 | "negative values." 106 | msgstr "" 107 | 108 | #: functions.py:406 109 | msgid "autocorrelation" 110 | msgstr "" 111 | 112 | #: functions.py:411 113 | msgid "Autocorrelation plot" 114 | msgstr "" 115 | 116 | #: functions.py:411 functions.py:472 117 | msgid "Lags" 118 | msgstr "" 119 | 120 | #: functions.py:411 121 | msgid "Autocorrelation" 122 | msgstr "" 123 | 124 | #: functions.py:471 125 | msgid "Cross-correlation using different algorithms" 126 | msgstr "" 127 | 128 | #: functions.py:473 129 | msgid "Correlation" 130 | msgstr "" 131 | 132 | #: functions.py:584 133 | msgid "Lag: " 134 | msgstr "" 135 | 136 | #: functions.py:689 137 | msgid "Box plot" 138 | msgstr "" 139 | 140 | #: functions.py:691 141 | msgid "The index refer to the end of the period." 142 | msgstr "" 143 | 144 | #: functions.py:728 145 | msgid "minute" 146 | msgstr "" 147 | 148 | #: functions.py:728 149 | msgid "hour" 150 | msgstr "" 151 | 152 | #: functions.py:728 153 | msgid "weekday" 154 | msgstr "" 155 | 156 | #: functions.py:728 157 | msgid "day" 158 | msgstr "" 159 | 160 | #: functions.py:728 161 | msgid "month" 162 | msgstr "" 163 | 164 | #: functions.py:728 165 | msgid "year" 166 | msgstr "" 167 | 168 | #: functions.py:783 169 | msgid "Aggregate box plot" 170 | msgstr "" 171 | 172 | #: functions.py:835 173 | msgid "unused data" 174 | msgstr "" 175 | 176 | #: functions.py:839 functions.py:1029 177 | msgid "training data" 178 | msgstr "" 179 | 180 | #: functions.py:846 181 | msgid "validation data" 182 | msgstr "" 183 | 184 | #: functions.py:851 185 | msgid "yhat" 186 | msgstr "" 187 | 188 | #: functions.py:855 189 | msgid "yhatlower" 190 | msgstr "" 191 | 192 | #: functions.py:858 193 | msgid "yhatupper" 194 | msgstr "" 195 | 196 | #: functions.py:862 197 | msgid "Best prediction for the validation set" 198 | msgstr "" 199 | 200 | #: functions.py:907 201 | msgid "This model, during the history, reached these performances on unseen data:" 202 | msgstr "" 203 | 204 | #: functions.py:909 205 | msgid "Range of validation data: " 206 | msgstr "" 207 | 208 | #: functions.py:915 209 | msgid "real data" 210 | msgstr "" 211 | 212 | #: functions.py:920 213 | msgid "historical prediction" 214 | msgstr "" 215 | 216 | #: functions.py:928 217 | msgid "future yhat" 218 | msgstr "" 219 | 220 | #: functions.py:934 functions.py:937 221 | msgid "Error series" 222 | msgstr "" 223 | 224 | #: functions.py:936 functions.py:940 225 | msgid "Historical prediction" 226 | msgstr "" 227 | 228 | #: functions.py:949 functions.py:957 229 | msgid "Error series histogram" 230 | msgstr "" 231 | 232 | #: functions.py:1042 233 | msgid "Performances with different training windows" 234 | msgstr "" 235 | 236 | #: functions.py:1090 237 | msgid "Model type: " 238 | msgstr "" 239 | 240 | #: functions.py:1091 241 | msgid "Values used for validation: last " 242 | msgstr "" 243 | 244 | #: functions.py:1091 245 | msgid " values" 246 | msgstr "" 247 | 248 | #: functions.py:1092 249 | msgid "The length of the training windows is the " 250 | msgstr "" 251 | 252 | #: functions.py:1093 253 | msgid " of the length of the time series." 254 | msgstr "" 255 | 256 | #: functions.py:1094 257 | msgid "Training windows are composed of " 258 | msgstr "" 259 | 260 | #: functions.py:1094 261 | msgid " values." 262 | msgstr "" 263 | 264 | #: functions.py:1095 265 | msgid "The model has used " 266 | msgstr "" 267 | 268 | #: functions.py:1095 269 | msgid " as extra-regressor(s) to improve the training." 270 | msgstr "" 271 | 272 | #: functions.py:1096 273 | msgid "The model has used a " 274 | msgstr "" 275 | 276 | #: functions.py:1096 277 | msgid " transformation on the input data." 278 | msgstr "" 279 | 280 | #: functions.py:1098 281 | msgid "The model has not used any pre/post transformation on input data." 282 | msgstr "" 283 | 284 | #: functions.py:1102 285 | msgid "Model characteristics:" 286 | msgstr "" 287 | 288 | #: functions.py:1104 289 | msgid "This model, using the best training window, reaches these performances:" 290 | msgstr "" 291 | 292 | #: functions.py:1139 293 | msgid "Arithmetic mean of errors:" 294 | msgstr "" 295 | 296 | #: functions.py:1140 297 | msgid "Standard deviation of errors: " 298 | msgstr "" 299 | 300 | -------------------------------------------------------------------------------- /timexseries/data_visualization/locales/en/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DhiriaDev/TIMEX/767841a830bdc6fafbe1702700b9f80175e357de/timexseries/data_visualization/locales/en/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /timexseries/data_visualization/locales/en/LC_MESSAGES/messages.po: -------------------------------------------------------------------------------- 1 | 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: PACKAGE VERSION\n" 5 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" 6 | "POT-Creation-Date: 2022-07-26 18:41+0200\n" 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 | "Last-Translator: FULL NAME \n" 9 | "Language: en\n" 10 | "Language-Team: English \n" 11 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 12 | "MIME-Version: 1.0\n" 13 | "Content-Type: text/plain; charset=utf-8\n" 14 | "Content-Transfer-Encoding: 8bit\n" 15 | "Generated-By: Babel 2.10.3\n" 16 | 17 | #: functions.py:99 18 | msgid " analysis" 19 | msgstr " analysis" 20 | 21 | #: functions.py:100 22 | msgid "Data visualization" 23 | msgstr "Data visualization" 24 | 25 | #: functions.py:115 26 | msgid "Cross-correlation" 27 | msgstr "Cross-correlation" 28 | 29 | #: functions.py:116 30 | msgid "" 31 | "Negative lags (left part) show the correlation between this scenario and " 32 | "the future of the others." 33 | msgstr "" 34 | "Negative lags (left part) show the correlation between this scenario and " 35 | "the future of the others." 36 | 37 | #: functions.py:118 38 | msgid "" 39 | "Meanwhile, positive lags (right part) shows the correlation between this " 40 | "scenario and the past of the others." 41 | msgstr "" 42 | "Meanwhile, positive lags (right part) shows the correlation between this " 43 | "scenario and the past of the others." 44 | 45 | #: functions.py:121 46 | msgid "" 47 | "The peaks found using each cross-correlation modality are shown in the " 48 | "graphs:" 49 | msgstr "" 50 | "The peaks found using each cross-correlation modality are shown in the " 51 | "graphs:" 52 | 53 | #: functions.py:132 54 | msgid "Training & Validation results" 55 | msgstr "Training & Validation results" 56 | 57 | #: functions.py:162 58 | msgid "Prediction" 59 | msgstr "Prediction" 60 | 61 | #: functions.py:163 62 | msgid "For every model the best predictions for each past date are plotted." 63 | msgstr "For every model the best predictions for each past date are plotted." 64 | 65 | #: functions.py:221 functions.py:249 66 | msgid "Line plot" 67 | msgstr "Line plot" 68 | 69 | #: functions.py:287 70 | msgid "Histogram" 71 | msgstr "Histogram" 72 | 73 | #: functions.py:287 functions.py:689 functions.py:783 74 | msgid "Count" 75 | msgstr "Count" 76 | 77 | #: functions.py:319 78 | msgid "Trend" 79 | msgstr "Trend" 80 | 81 | #: functions.py:319 82 | msgid "Seasonality" 83 | msgstr "Seasonality" 84 | 85 | #: functions.py:319 86 | msgid "Residual" 87 | msgstr "Residual" 88 | 89 | #: functions.py:353 90 | msgid "Components decomposition" 91 | msgstr "Components decomposition" 92 | 93 | #: functions.py:353 94 | msgid "Decomposition model" 95 | msgstr "Decomposition model" 96 | 97 | #: functions.py:354 98 | msgid "Additive" 99 | msgstr "Additive" 100 | 101 | #: functions.py:355 102 | msgid "Multiplicative" 103 | msgstr "Multiplicative" 104 | 105 | #: functions.py:361 106 | msgid "" 107 | "Multiplicative model is not available for series which contain zero or " 108 | "negative values." 109 | msgstr "" 110 | "Multiplicative model is not available for series which contain zero or " 111 | "negative values." 112 | 113 | #: functions.py:406 114 | msgid "autocorrelation" 115 | msgstr "Autocorrelation" 116 | 117 | #: functions.py:411 118 | msgid "Autocorrelation plot" 119 | msgstr "Autocorrelation plot" 120 | 121 | #: functions.py:411 functions.py:472 122 | msgid "Lags" 123 | msgstr "Lags" 124 | 125 | #: functions.py:411 126 | msgid "Autocorrelation" 127 | msgstr "Autocorrelation" 128 | 129 | #: functions.py:471 130 | msgid "Cross-correlation using different algorithms" 131 | msgstr "Cross-correlation using different algorithms" 132 | 133 | #: functions.py:473 134 | msgid "Correlation" 135 | msgstr "Correlation" 136 | 137 | #: functions.py:584 138 | msgid "Lag: " 139 | msgstr "Lag: " 140 | 141 | #: functions.py:689 142 | msgid "Box plot" 143 | msgstr "Box plot" 144 | 145 | #: functions.py:691 146 | msgid "The index refer to the end of the period." 147 | msgstr "The index refers to the end of the period." 148 | 149 | #: functions.py:728 150 | msgid "minute" 151 | msgstr "Minute" 152 | 153 | #: functions.py:728 154 | msgid "hour" 155 | msgstr "Hour" 156 | 157 | #: functions.py:728 158 | msgid "weekday" 159 | msgstr "Weekday" 160 | 161 | #: functions.py:728 162 | msgid "day" 163 | msgstr "Day of month" 164 | 165 | #: functions.py:728 166 | msgid "month" 167 | msgstr "Month" 168 | 169 | #: functions.py:728 170 | msgid "year" 171 | msgstr "Year" 172 | 173 | #: functions.py:783 174 | msgid "Aggregate box plot" 175 | msgstr "Aggregate box plot" 176 | 177 | #: functions.py:835 178 | msgid "unused data" 179 | msgstr "Unused data" 180 | 181 | #: functions.py:839 functions.py:1029 182 | msgid "training data" 183 | msgstr "Training data" 184 | 185 | #: functions.py:846 186 | msgid "validation data" 187 | msgstr "Validation data" 188 | 189 | #: functions.py:851 190 | msgid "yhat" 191 | msgstr "Prediction" 192 | 193 | #: functions.py:855 194 | msgid "yhatlower" 195 | msgstr "Prediction (lowerbound)" 196 | 197 | #: functions.py:858 198 | msgid "yhatupper" 199 | msgstr "Prediction (upperbound)" 200 | 201 | #: functions.py:862 202 | msgid "Best prediction for the validation set" 203 | msgstr "Best prediction for the validation set" 204 | 205 | #: functions.py:907 206 | msgid "This model, during the history, reached these performances on unseen data:" 207 | msgstr "This model, during the history, reached these performances on unseen data:" 208 | 209 | #: functions.py:909 210 | msgid "Range of validation data: " 211 | msgstr "Range of validation data: " 212 | 213 | #: functions.py:915 214 | msgid "real data" 215 | msgstr "Real data" 216 | 217 | #: functions.py:920 218 | msgid "historical prediction" 219 | msgstr "Historical prediction" 220 | 221 | #: functions.py:928 222 | msgid "future yhat" 223 | msgstr "Future prediction" 224 | 225 | #: functions.py:934 functions.py:937 226 | msgid "Error series" 227 | msgstr "Error series" 228 | 229 | #: functions.py:936 functions.py:940 230 | msgid "Historical prediction" 231 | msgstr "Historical prediction" 232 | 233 | #: functions.py:949 functions.py:957 234 | msgid "Error series histogram" 235 | msgstr "Error series histogram" 236 | 237 | #: functions.py:1042 238 | msgid "Performances with different training windows" 239 | msgstr "Performances with different training windows" 240 | 241 | #: functions.py:1090 242 | msgid "Model type: " 243 | msgstr "Model type: " 244 | 245 | #: functions.py:1091 246 | #, fuzzy 247 | msgid "Values used for validation: last " 248 | msgstr "Values used for validation: last " 249 | 250 | #: functions.py:1091 251 | msgid " values" 252 | msgstr " values" 253 | 254 | #: functions.py:1092 255 | msgid "The length of the training windows is the " 256 | msgstr "The length of the training windows is the " 257 | 258 | #: functions.py:1093 259 | msgid " of the length of the time series." 260 | msgstr " of the length of the time series." 261 | 262 | #: functions.py:1094 263 | msgid "Training windows are composed of " 264 | msgstr "Training windows are composed of " 265 | 266 | #: functions.py:1094 267 | msgid " values." 268 | msgstr " values." 269 | 270 | #: functions.py:1095 271 | msgid "The model has used " 272 | msgstr "The model has used " 273 | 274 | #: functions.py:1095 275 | msgid " as extra-regressor(s) to improve the training." 276 | msgstr " as extra-regressor(s) to improve the training." 277 | 278 | #: functions.py:1096 279 | msgid "The model has used a " 280 | msgstr "The model has used a " 281 | 282 | #: functions.py:1096 283 | msgid " transformation on the input data." 284 | msgstr " transformation on the input data." 285 | 286 | #: functions.py:1098 287 | msgid "The model has not used any pre/post transformation on input data." 288 | msgstr "The model has not used any pre/post transformation on input data." 289 | 290 | #: functions.py:1102 291 | msgid "Model characteristics:" 292 | msgstr "Model characteristics:" 293 | 294 | #: functions.py:1104 295 | msgid "This model, using the best training window, reaches these performances:" 296 | msgstr "This model, using the best training window, reaches these performances:" 297 | 298 | #: functions.py:1139 299 | msgid "Arithmetic mean of errors:" 300 | msgstr "Arithmetic mean of errors: " 301 | 302 | #: functions.py:1140 303 | msgid "Standard deviation of errors: " 304 | msgstr "Standard deviation of errors: " 305 | 306 | -------------------------------------------------------------------------------- /timexseries/data_visualization/locales/it/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DhiriaDev/TIMEX/767841a830bdc6fafbe1702700b9f80175e357de/timexseries/data_visualization/locales/it/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /timexseries/data_visualization/locales/it/LC_MESSAGES/messages.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2021 ORGANIZATION 3 | # FIRST AUTHOR , 2021. 4 | # 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: PACKAGE VERSION\n" 8 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" 9 | "POT-Creation-Date: 2022-07-26 18:41+0200\n" 10 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 11 | "Last-Translator: FULL NAME \n" 12 | "Language: it\n" 13 | "Language-Team: Italian \n" 14 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=utf-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Generated-By: Babel 2.10.3\n" 19 | 20 | #: functions.py:99 21 | msgid " analysis" 22 | msgstr " analisi" 23 | 24 | #: functions.py:100 25 | msgid "Data visualization" 26 | msgstr "Visualizzazione dei dati" 27 | 28 | #: functions.py:115 29 | msgid "Cross-correlation" 30 | msgstr "Cross-correlazione" 31 | 32 | #: functions.py:116 33 | msgid "" 34 | "Negative lags (left part) show the correlation between this scenario and " 35 | "the future of the others." 36 | msgstr "" 37 | "I ritardi negativi (parte sinistra) mostrano la correlazione tra questo " 38 | "scenario e il futuro degli altri." 39 | 40 | #: functions.py:118 41 | msgid "" 42 | "Meanwhile, positive lags (right part) shows the correlation between this " 43 | "scenario and the past of the others." 44 | msgstr "" 45 | "Invece, i ritardi positivi (parte destra) mostrano la correlazione tra " 46 | "questo scenario e il passato degli altri." 47 | 48 | #: functions.py:121 49 | msgid "" 50 | "The peaks found using each cross-correlation modality are shown in the " 51 | "graphs:" 52 | msgstr "" 53 | "I picchi raggiunti usando ciascuna modalità di cross-correlazione sono " 54 | "mostrati nel/nei grafo/grafi:" 55 | 56 | #: functions.py:132 57 | msgid "Training & Validation results" 58 | msgstr "Risultati dell'allenamento del modello" 59 | 60 | #: functions.py:162 61 | msgid "Prediction" 62 | msgstr "Predizione" 63 | 64 | #: functions.py:163 65 | msgid "For every model the best predictions for each past date are plotted." 66 | msgstr "" 67 | "Per ciascun modello vengono mostrate le migliori predizioni ottenibili in" 68 | " ciascuna data passata." 69 | 70 | #: functions.py:221 functions.py:249 71 | msgid "Line plot" 72 | msgstr "Grafico" 73 | 74 | #: functions.py:287 75 | msgid "Histogram" 76 | msgstr "Istogramma" 77 | 78 | #: functions.py:287 functions.py:689 functions.py:783 79 | msgid "Count" 80 | msgstr "Conteggio" 81 | 82 | #: functions.py:319 83 | msgid "Trend" 84 | msgstr "Trend" 85 | 86 | #: functions.py:319 87 | msgid "Seasonality" 88 | msgstr "Stagionalità" 89 | 90 | #: functions.py:319 91 | msgid "Residual" 92 | msgstr "Residuo" 93 | 94 | #: functions.py:353 95 | msgid "Components decomposition" 96 | msgstr "Decomposizione in componenti" 97 | 98 | #: functions.py:353 99 | msgid "Decomposition model" 100 | msgstr "Modello di decomposizione" 101 | 102 | #: functions.py:354 103 | msgid "Additive" 104 | msgstr "Additivo" 105 | 106 | #: functions.py:355 107 | msgid "Multiplicative" 108 | msgstr "Moltiplicativo" 109 | 110 | #: functions.py:361 111 | msgid "" 112 | "Multiplicative model is not available for series which contain zero or " 113 | "negative values." 114 | msgstr "" 115 | "Il modello moltiplicativo non è disponibile in serie che contengono " 116 | "valori nulli o negativi." 117 | 118 | #: functions.py:406 119 | msgid "autocorrelation" 120 | msgstr "Autocorrelazione" 121 | 122 | #: functions.py:411 123 | msgid "Autocorrelation plot" 124 | msgstr "Grafico dell'autocorrelazione" 125 | 126 | #: functions.py:411 functions.py:472 127 | msgid "Lags" 128 | msgstr "Ritardi" 129 | 130 | #: functions.py:411 131 | msgid "Autocorrelation" 132 | msgstr "Autocorrelazione" 133 | 134 | #: functions.py:471 135 | msgid "Cross-correlation using different algorithms" 136 | msgstr "Cross-correlazione usando vari algoritmi" 137 | 138 | #: functions.py:473 139 | msgid "Correlation" 140 | msgstr "Correlazione" 141 | 142 | #: functions.py:584 143 | msgid "Lag: " 144 | msgstr "Ritardi: " 145 | 146 | #: functions.py:689 147 | msgid "Box plot" 148 | msgstr "Diagramma a scatola" 149 | 150 | #: functions.py:691 151 | msgid "The index refer to the end of the period." 152 | msgstr "L'indice fa riferimento alla fine del periodo considerato." 153 | 154 | #: functions.py:728 155 | msgid "minute" 156 | msgstr "Minuto" 157 | 158 | #: functions.py:728 159 | msgid "hour" 160 | msgstr "Ora" 161 | 162 | #: functions.py:728 163 | msgid "weekday" 164 | msgstr "Giorno della settimana" 165 | 166 | #: functions.py:728 167 | msgid "day" 168 | msgstr "Giorno del mese" 169 | 170 | #: functions.py:728 171 | msgid "month" 172 | msgstr "Mese" 173 | 174 | #: functions.py:728 175 | msgid "year" 176 | msgstr "Anno" 177 | 178 | #: functions.py:783 179 | msgid "Aggregate box plot" 180 | msgstr "Diagramma a scatola aggregato" 181 | 182 | #: functions.py:835 183 | msgid "unused data" 184 | msgstr "Dati non usati" 185 | 186 | #: functions.py:839 functions.py:1029 187 | msgid "training data" 188 | msgstr "Dati usati nell'allenamento" 189 | 190 | #: functions.py:846 191 | msgid "validation data" 192 | msgstr "Dati di validazione" 193 | 194 | #: functions.py:851 195 | msgid "yhat" 196 | msgstr "Predizione" 197 | 198 | #: functions.py:855 199 | msgid "yhatlower" 200 | msgstr "Predizione (limite inferiore)" 201 | 202 | #: functions.py:858 203 | msgid "yhatupper" 204 | msgstr "Predizione (limite superiore)" 205 | 206 | #: functions.py:862 207 | msgid "Best prediction for the validation set" 208 | msgstr "Miglior previsione per i dati di validazione" 209 | 210 | #: functions.py:907 211 | msgid "This model, during the history, reached these performances on unseen data:" 212 | msgstr "" 213 | "Questo modello, nella storia della serie, ha raggiunto queste " 214 | "performances su dati non visti:" 215 | 216 | #: functions.py:909 217 | msgid "Range of validation data: " 218 | msgstr "Range dei dati di validazione: " 219 | 220 | #: functions.py:915 221 | msgid "real data" 222 | msgstr "Dati reali" 223 | 224 | #: functions.py:920 225 | msgid "historical prediction" 226 | msgstr "Previsione storica" 227 | 228 | #: functions.py:928 229 | msgid "future yhat" 230 | msgstr "Previsione futura" 231 | 232 | #: functions.py:934 functions.py:937 233 | msgid "Error series" 234 | msgstr "Errore" 235 | 236 | #: functions.py:936 functions.py:940 237 | msgid "Historical prediction" 238 | msgstr "Previsione storica" 239 | 240 | #: functions.py:949 functions.py:957 241 | msgid "Error series histogram" 242 | msgstr "Istogramma dell'errore" 243 | 244 | #: functions.py:1042 245 | msgid "Performances with different training windows" 246 | msgstr "Performances con differenti finestre di allenamento" 247 | 248 | #: functions.py:1090 249 | msgid "Model type: " 250 | msgstr "Classe del modello: " 251 | 252 | #: functions.py:1091 253 | #, fuzzy 254 | msgid "Values used for validation: last " 255 | msgstr "Valori usati per il testing: ultimi " 256 | 257 | #: functions.py:1091 258 | msgid " values" 259 | msgstr " valori" 260 | 261 | #: functions.py:1092 262 | msgid "The length of the training windows is the " 263 | msgstr "La lunghezza della finestra di addestramento è il " 264 | 265 | #: functions.py:1093 266 | msgid " of the length of the time series." 267 | msgstr " della lunghezza della serie temporale." 268 | 269 | #: functions.py:1094 270 | msgid "Training windows are composed of " 271 | msgstr "Le finestre di allenamento sono composte del " 272 | 273 | #: functions.py:1094 274 | msgid " values." 275 | msgstr " valori." 276 | 277 | #: functions.py:1095 278 | msgid "The model has used " 279 | msgstr "Il modello ha usato " 280 | 281 | #: functions.py:1095 282 | msgid " as extra-regressor(s) to improve the training." 283 | msgstr " come regressore/i extra per migliorare l'addestramento." 284 | 285 | #: functions.py:1096 286 | msgid "The model has used a " 287 | msgstr "Il modello ha usato una " 288 | 289 | #: functions.py:1096 290 | msgid " transformation on the input data." 291 | msgstr " trasformazione sui dati." 292 | 293 | #: functions.py:1098 294 | msgid "The model has not used any pre/post transformation on input data." 295 | msgstr "Il modello non ha usato pre/post trasformazioni sui dati." 296 | 297 | #: functions.py:1102 298 | msgid "Model characteristics:" 299 | msgstr "Caratteristiche del modello:" 300 | 301 | #: functions.py:1104 302 | msgid "This model, using the best training window, reaches these performances:" 303 | msgstr "" 304 | "Questo modello, usando la miglior finestra di allenamento, raggiunge " 305 | "queste performances:" 306 | 307 | #: functions.py:1139 308 | msgid "Arithmetic mean of errors:" 309 | msgstr "Media aritmetica dell'errore: " 310 | 311 | #: functions.py:1140 312 | msgid "Standard deviation of errors: " 313 | msgstr "Deviazione standard dell'errore: " 314 | 315 | --------------------------------------------------------------------------------