Skip to content

nhsx/Time_Series_Forecasting_MS

Repository files navigation

Time Series Forecasting - Model Comparison

NHS England Digital Analytics and Research Team

About the Project

status: experimental

This repository holds code for the forecasting comparison work - a short term project developed by Milan Storey whilst on DDaT placement with DART in Nov/Dec 2023

Note: Only public or fake data are shared in this repository.

Project Stucture

The main code is found in the src folder of the repository.

.
├── docs                    # Documentation
├── src                     # Source files
├── .gitignore
├── mkdocs.yml              # Documentation page   
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENCE
├── OPEN_CODE_CHECKLIST.md
├── README.md
└── requirements.txt

Getting Started

Installation

To get a local copy up and running follow these simple steps.

To clone the repo:

`git clone https://github.com/nhsx/Time_Series_Forecasting_MS

To create a suitable environment:

  • python3.8 -m venv ~/venv/py3.8
  • source venv/bin/activate
  • pip install -r requirements.txt

You can serve the documentation locally using mkdocs serve.

Usage

src
├── ACF+PACF                 # Contains code to determine order of SARIMA model
├── Data                     # Contains data Files
├── Function                 # Contains the functions used in the main pipeline
├── Model Selection          # Contains the main pipeline where a model is selected   
├── Models                   # Contains the models
├── Prophet Scripts          # Contains a script to run the prophet model and the prophet model outputs
├── __init__.py

step 1: Run the acf/pacf script.

Determine the order of the SARIMA model by running the relevant script in the ACF+PACF folder. Guidance on how to interpret the resulting plots is provided in the mkdocs documentation page.

step 2: Run the prophet script.

Note the prophet function is only currently compatible with python <3.9, so this script must be run in a suitable environment.

step 3: Run the model selection script.

See mkdocs documentation page for what the outputs of this script look like, aswell as guidance on what parameters must be set prior to running.

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

See CONTRIBUTING.md for detailed guidance.

License

Unless stated otherwise, the codebase is released under the MIT Licence. This covers both the codebase and any sample code in the documentation.

See LICENSE for more information.

The documentation is © Crown copyright and available under the terms of the Open Government 3.0 licence.

Another Forecasting resource

For a simpler look into Forecasting with some beginner workbooks to go through, please see this repo Forecasting_1.

Contact

Primary Contact is Milan Storey ([email protected]). Supervisor is Paul Carroll ([email protected]).

To find out more about the Analytics Unit visit our project website or get in touch at [email protected].