GithubHelp home page GithubHelp logo

microsoft / fost Goto Github PK

View Code? Open in Web Editor NEW
248.0 9.0 45.0 281 KB

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.

License: MIT License

Python 100.00%

fost's Introduction

FOST

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.

Framework of FOST

Following is the framework of FOST, basically it contains 4 main components:

FOST framework

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.

Quick Start

Installation

Installation of dependency packages

1. Prerequisites

This project relies on pytorch >= 1.8 and torch-geometric >= 1.7.2

2. Installation

You can install fost with pip:

pip install fostool

Train with FOST

1. Import forecasting pipeline

from fostool.pipeline import Pipeline

2. Setting data path and lookahead

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.

3. Fit and 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()

4. Plot results

fost.plot(result)

Data Format

You can fetch sample data on /examples

1. train.csv

3 columns are required for train.csv:

  • Node: node name for current data
  • Date: date or timestamp for current data
  • TARGET: target for prediction

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.

2. graph.csv (option)

graph.csv should only contains 3 columns:

  • node_0: node name for fist node, node name should align with node name in train.csv.
  • node_1: node name for second node, node name should align with node name in train.csv.
  • weight: weight on connection for node_0 to node_1.

If graph.csv is not provided, identity graph will be used.

Examples

We prepared several examples on examples:

  1. Predict simulation cosine curve
  2. Predict States Energy Data
  3. Save and load model

Contact Us

  • If you have any issues, please create issue here or send messages in gitter.
  • For other reasons, you are welcome to contact us by email([email protected]).

fost's People

Contributors

agiamason avatar chlxydl avatar dolphin-zs avatar microsoft-github-operations[bot] avatar microsoftopensource avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fost's Issues

fost.plot data miss-ordered

if the train.csv data is ordered in descending order by date, fost.plot will not give the correct result. I got something like this with lookahead=lookback_size=300 (day):
image

unhashable type

when I run the code:
#predict future 10 steps
lookahead = 10
fost = Pipeline(lookahead=lookahead, train_path='train.csv')

in the 1. Cosine prediction.ipynb
I meet some error
TypeError: unhashable type: 'pandas._libs.tslibs.offsets.Day'

how could I solve it

gconv.py

Are there any papers to describe principles of the sentence 'Build an edge-attribute-aware graph convolutional layer' in class EGNNConv?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.