FOST is a general forecasting tool, which demonstrate our experience and advanced technology in practical forecasting domains, including temporal, spatial-temporal and hierarchical forecasting. Current general forecasting tools (Gluon-TS by amazon, Prophet by facebook etc.) can not process and model structural graph data, especially in spatial domains, also those tools suffer from tradeoff between usability and accuracy. To address these challenges, we design and develop FOST and aims to empower engineers and data scientists to build high-accuracy and easy-usability forecasting tools.
FOST(Forecasting open source tool) aims to provide an easy-use tool for spatial-temporal forecasting. The users only need to organize their data into a certain format and then get the prediction results with one command. FOST automatically handles the missing and abnormal values, and captures both spatial and temporal correlations efficiently.
Following is the framework of FOST, basically it contains 4 main components:
Module name | Description |
---|---|
Preprocessing | Preprocessing module aims at handle varies data situation, currently FOST designed sub-module to handle issues such as missing value, unalignment timestamp and feature selection. |
Modeling | FOST contains implements for different mainstream deep learning models such as RNN, MLP and GNN, for better performance on varies custom data. Further model implements such as Transformer, N-beats are in progress. |
Fusion | Fusion module aims at automatically select and ensemble model predictions. |
Utils | There are many other utils in FOST, such as neural-network trainer and predictor, result plotter and so on. |
This project relies on pytorch >= 1.8
and torch-geometric >= 1.7.2
torch installation reference link:https://pytorch.org/get-started/previous-versions/
torch-geometric installation reference link: https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html
You can install fost with pip:
pip install fostool
from fostool.pipeline import Pipeline
You need to pass your train.csv
and graph.csv
for model training, see dataformat for data preparing.
train_path = '/path/to/your/train.csv'
graph_path = '/path/to/your/graph.csv' # graph_path is alternative
lookahead = 7 # Forward steps you would like to predict.
We provide a default config file in config/default.yaml. You could use your config file through config_path augment.
fost = Pipeline(lookahead=lookahead, train_path=train_path, graph_path=graph_path)
fost.fit()
result = fost.predict()
fost.plot(result)
You can fetch sample data on
/examples
3 columns are required for train.csv
:
A valid format may look like:
Node | Date | TARGET |
---|---|---|
Alaska | 1960-01-01 | 800592.0 |
Alaska | 1961-01-01 | 933600.0 |
Alabama | 1960-01-01 | 10141633.0 |
Alabama | 1961-01-01 | 9885992.0 |
Alabama | 1962-01-01 | 10497917.0 |
Columns except above will be regarded as feature columns.
graph.csv
should only contains 3 columns:
train.csv
.train.csv
.If graph.csv
is not provided, identity graph will be used.
We prepared several examples on examples
: