{"id":25836093,"url":"https://github.com/aybchan/uber-time-series","last_synced_at":"2025-03-01T01:39:25.942Z","repository":{"id":41408770,"uuid":"262561946","full_name":"aybchan/uber-time-series","owner":"aybchan","description":"Bayesian time series prediction","archived":false,"fork":false,"pushed_at":"2020-10-12T17:16:38.000Z","size":19234,"stargazers_count":41,"open_issues_count":4,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-01T03:55:57.124Z","etag":null,"topics":["deep-learning","probabilistic-forecasting","pytorch","time-series"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aybchan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-09T12:04:19.000Z","updated_at":"2023-02-19T21:17:02.000Z","dependencies_parsed_at":"2022-09-21T08:00:59.249Z","dependency_job_id":null,"html_url":"https://github.com/aybchan/uber-time-series","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aybchan%2Fuber-time-series","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aybchan%2Fuber-time-series/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aybchan%2Fuber-time-series/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aybchan%2Fuber-time-series/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aybchan","download_url":"https://codeload.github.com/aybchan/uber-time-series/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241304291,"owners_count":19941100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","probabilistic-forecasting","pytorch","time-series"],"created_at":"2025-03-01T01:39:25.498Z","updated_at":"2025-03-01T01:39:25.928Z","avatar_url":"https://github.com/aybchan.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bayesian time series prediction\n![Time series predictions with test set data](docs/predictions.gif)\n\nEnd to end implementation of paper [Deep and Confident Prediction for Time Series at Uber](https://arxiv.org/abs/1709.01907) in PyTorch. We use the [Metro Interstate Traffic Volume](https://archive.ics.uci.edu/ml/datasets/Metro+Interstate+Traffic+Volume) multivariate time series dataset for training and eventually predicting traffic volume.\n\nWe make use of the implementation of [variational dropout](https://arxiv.org/abs/1512.05287) from [keitakurita/Better_LSTM_PyTorch](https://github.com/keitakurita/Better_LSTM_PyTorch) for the LSTM layers with dropout.\n\n## Workflow\n\u003cimg src=\"docs/architecture.png\" width=480 align=center\u003e\n\nCode is prototyped in the [`notebooks`](notebooks) before transfer into cleaned up Python scripts for reuse.\n\n- [`notebooks/01_dataset_creation.ipynb`](notebooks/01_dataset_creation.ipynb)\n  - Download dataset from UCI repository, preprocessing, cleaning and feature creation\n  - → [`src/data.py`](src/data.py)\n- [`notebooks/02_encoder_decoder.ipynb`](notebooks/02_encoder_decoder.ipynb)\n  - Prototype the encoder-decoder pretraining part of the model\n  - → [`models/encoder_decoder.py`](models/encoder_decoder.py)\n  - → [`src/utils.py`](src/utils.py)\n- [`notebooks/03_encoder_decoder_dropout.ipynb`](notebooks/03_encoder_decoder_dropout.ipynb)\n  - Prototype the encoder-decoder pretraining part of the model using [LSTM cells with dropout](https://github.com/keitakurita/Better_LSTM_PyTorch)\n  - → [`models/encoder_decoder_dropout.py`](models/encoder_decoder_dropout.py)\n\n- [`notebooks/04_pretraining_hyperparam.ipynb`](notebooks/04_pretraining_hyperparam.ipynb)\n  - Use [`Ax`](https://github.com/facebook/Ax) for guided hyperparameter search in the pretraining of encoder-decoder. We use GCE compute for GPU acceleration\n  - → [`src/utils.py`](src/utils.py)\n- [`notebooks/05_pretraining_embedding.ipynb`](notebooks/05_pretraining_embedding.ipynb)\n  - Taking a look at the learned pretraining embedding\n  - → [`src/utils.py`](src/utils.py)\n- [`notebooks/06_prediction_network.ipynb`](notebooks/06_prediction_network.ipynb)\n  - Prototype the prediction network and run `Ax` for hyperparameter search\n  - → [`src/utils.py`](src/utils.py)\n  - → [`src/data.py`](src/data.py)\n  - → [`models/prediction.py`](models/prediction.py)\n- [`notebooks/07_full_inference.ipynb`](notebooks/07_full_inference.ipynb)\n  - Implement the full inference including uncertainty calculation algorithms, run the test data through inference and plot results\n  - → [`src/inference.py`](src/inference.py)\n- [`notebooks/08_evaluation.ipynb`](notebooks/08_evaluation.ipynb)\n  - Evaluate predictions on the test set by comparing with predictions from [facebook/prophet](https://github.com/facebook/prophet)\n  - → [`src/evaluation.py`](src/evaluation.py)\n\n## Results\n\nIn [`notebooks/08_evaluation.ipynb`](notebooks/08_evaluation.ipynb) Prediction results on the test set are compared to those made with [facebook/prophet](https://github.com/facebook/prophet). \n\nResults on the classical time series prediction evaluation metrics are presented below:\n\n| Metric                                   |  Uber    | Prophet |\n| ---------------------------------------- | -------- | ------- |\n| Mean absolute error                      | 280.47   | 680.98  |\n| Root mean squared error                  | 490.92   | 955.85  |\n| Mean absolute percentage error           | 0.13     | 0.41    |\n| Symmetric mean absolute percentage error | 0.029    | 0.024   |\n\n\nTime series predicitons using the full inference algorithm including uncertainty bounds:\n![Time series predictions with test set data](docs/results.png)\n\n\n## Requirements\n```\nnumpy\npandas\ntorch\ntqdm\nmatplotlib\nax-platform\nfb-prophet\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faybchan%2Fuber-time-series","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faybchan%2Fuber-time-series","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faybchan%2Fuber-time-series/lists"}