No project description provided
Project description
Stepshifter: Time-series Forecasting Model 🔮
Part of the VIEWS Platform ecosystem for large-scale conflict forecasting.
📚 Table of Contents
- Overview
- Role in the VIEWS Pipeline
- Features
- Installation
- Usage
- Architecture
- Project Structure
- Contributing
- License
- Acknowledgements
🧠 Overview
Stepshifter is a machine learning model designed for time-series forecasting using Darts. It solves [regression and classification] tasks.
Key Capabilities:
- Probabilistic Outputs: Binary outputs and point predictions.
- Learning Approach:
LinearRegressionModel,RandomForest,LightGBMModel,XGBModel,HurdleModel.
- Integration-Ready: Built to seamlessly integrate into the larger VIEWS Pipeline.
🌍 Role in the VIEWS Pipeline
Stepshifter serves as part of the Violence & Impacts Early Warning System (VIEWS) pipeline. It complements the following repositories:
- views-pipeline-core: For data ingestion and preprocessing.
- views-models: Handles training, testing, and deployment.
- views-evaluation: Evaluates and calibrates model outputs.
- docs: Organization/pipeline level documentation.
Integration Workflow
Stepshifter fits into the pipeline as follows:
- Data Input: Processes preprocessed data from views-pipeline-core.
- Model Execution: This modeling approach involves shifting all independent variables in time, in order to train models that can predict future values of the dependent variable.
- Post-Processing: Outputs are sent to views-evaluation for further analysis.
✨ Features
- Darts models: Stepshifter model class supports multiple Darts forecasting models, including
LinearRegressionModel,RandomForest,LightGBMModel, andXGBModel. - Automated Data Cleanup: Stepshifter model class automatically processes missing data and ensures consistent multi-index formatting for time-series data.
- Hurdle model: Hurdle model class inherits from StepshifterModel.
A hurdle model consists of two stages:
- Binary stage: Predicts whether the target variable is 0 or > 0.
- Positive stage: Predicts the value of the target variable when it is > 0.
⚙️ Installation
Prerequisites
- Python >= 3.11
- Access to views-pipeline-core.
Steps
See the organization/pipeline level docs
🚀 Usage
1. Run Training Locally
See the organization/pipeline level docs
2. Use in the VIEWS Pipeline
Stepshifter integrates seamlessly with the VIEWS pipeline. After processing, outputs can be passed to views-evaluation for further calibration or ensembling.
🏗 Architecture
1. Stepshifter Model
This modeling approach involves shifting all independent variables in time, in order to train models that can predict future values of the dependent variable. More details can be found in Appendix A of Hegre et al. (2020).
2. Hurdle Model
This approach differs from a traditional implementation in three aspects:
- In the first stage, since Darts doesn't support classification models, a regression model is used instead. These estimates are not strictly bounded between 0 and 1, but this is acceptable for the purpose of this step.
- To determine whether an observation is classified as "positive," we apply a threshold. The default threshold is 1, meaning that predictions above this value are considered positive outcomes. It is not set as 0 because most predictions won't be exactly 0. This threshold can be adjusted as a tunable hyperparameter to better suit specific requirements.
- In the second stage, a regression model is used to predict for the selected time series. Since Darts time series require a continuous timestamp, we can't get rid of those timestamps with negative prediction produced in the first stage like a traditional implementation. Instead we include the entire time series for countries or PRIO grids where the first stage yielded at least one positive prediction.
🚦 Workflow
- Input: VIEWS historical conflict data.
- Processing: Converting to Darts time series data.
- Prediction: Regression predictions.
Refer to the Appendix A of Hegre et al. (2020) for an in-depth explanation.
For more detailed information about the VIEWS Stepshifter models themselves, refer to the VIEWS models catalog.
🗂 Project Structure
views-stepshifter/
├── README.md # Documentation
├── tests # Unit and integration tests
├── views-stepshifter # Main source code
│ ├── manager # Management of stepshifter model lifecycle
│ ├── models # Model algorithms
│ ├── src # Folder template
│ ├── __init__.py # Package initialization
├── .gitignore # Git ignore rules
├── pyproject.toml # Poetry project file
├── poetry.lock # Dependency lock file
🤝 Contributing
We welcome contributions to this project! Please follow the guidelines in the VIEWS Documentation.
📜 License
This project is licensed under the LICENSE file.
💬 Acknowledgements
Special thanks to the VIEWS MD&D Team for their collaboration and support.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file views_stepshifter-1.0.2.tar.gz.
File metadata
- Download URL: views_stepshifter-1.0.2.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.11.13 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5645624205084577567dea4307c04df161e7950fb3f6c26d8d6919657b0c03f
|
|
| MD5 |
23fb802854ad09620cab24c91cfb95ae
|
|
| BLAKE2b-256 |
ebbd3ad24bd3a3db2de60d44fcd906efafe9a174f2d6ccf6e753a63f4060b41b
|
File details
Details for the file views_stepshifter-1.0.2-py3-none-any.whl.
File metadata
- Download URL: views_stepshifter-1.0.2-py3-none-any.whl
- Upload date:
- Size: 23.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.11.13 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d993bc93b641e39ed94b2559a9674dbb93572e4159b6b3df6d4d3312d2b98a1e
|
|
| MD5 |
587fc372d378fa4a174be7ef8720c6c6
|
|
| BLAKE2b-256 |
2236d5485aa236fee8448f650e0222e8e788d7dbecb9a0534f563c7b5276fa19
|