{"id":13526468,"url":"https://github.com/microsoft/FOST","last_synced_at":"2025-04-01T07:32:33.020Z","repository":{"id":39597562,"uuid":"419664948","full_name":"microsoft/FOST","owner":"microsoft","description":"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.","archived":false,"fork":false,"pushed_at":"2023-02-14T08:06:16.000Z","size":281,"stargazers_count":261,"open_issues_count":5,"forks_count":44,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-30T21:38:10.533Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null}},"created_at":"2021-10-21T09:43:40.000Z","updated_at":"2025-03-10T13:22:04.000Z","dependencies_parsed_at":"2022-09-19T08:01:53.796Z","dependency_job_id":"808139ea-ff07-4843-b036-b3aaf3e17abf","html_url":"https://github.com/microsoft/FOST","commit_stats":{"total_commits":15,"total_committers":4,"mean_commits":3.75,"dds":0.4666666666666667,"last_synced_commit":"5dc0e1ec0cd906f781eaf416105722e9693f7e6e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FFOST","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FFOST/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FFOST/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FFOST/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/FOST/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246600825,"owners_count":20803489,"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":[],"created_at":"2024-08-01T06:01:30.196Z","updated_at":"2025-04-01T07:32:28.011Z","avatar_url":"https://github.com/microsoft.png","language":"Python","funding_links":[],"categories":["Code-Resource","📦 Packages","Table of Contents","时空网络_交通预测_动态图"],"sub_categories":["2020","Python","网络服务_其他"],"readme":"\u003c!-- [![Python Versions](https://img.shields.io/pypi/pyversions/fostool.svg?logo=python\u0026logoColor=white)](https://test.pypi.org/project/fostool/0.2.3/#files)\n[![Platform](https://img.shields.io/badge/platform-linux%20%7C%20windows%20%7C%20macos-lightgrey)](https://test.pypi.org/project/fostool/0.2.3/#files)\n[![PypI Versions](https://img.shields.io/pypi/v/fostool)](https://pypi.org/project/fostool/#history)\n[![Upload Python Package](https://github.com/microsoft/fost/workflows/Upload%20Python%20Package/badge.svg)](https://pypi.org/project/fostool/)\n[![Github Actions Test Status](https://github.com/microsoft/fost/workflows/Test/badge.svg?branch=main)](https://github.com/microsoft/fost/actions)\n[![Documentation Status](https://readthedocs.org/projects/fost/badge/?version=latest)](https://fost.readthedocs.io/en/latest/?badge=latest)\n[![License](https://img.shields.io/pypi/l/fostool)](LICENSE)\n[![Join the chat at https://gitter.im/Microsoft/fostool](https://badges.gitter.im/Microsoft/fostool.svg)](https://gitter.im/Microsoft/fostool?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) --\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://dsm01pap002files.storage.live.com/y4mueD2H6WE6Df3edTW6YE_KLeND5ROVCKksKxGarweSuk9VW2m4jrY8EBTVN5qXiQEnuyfSQZ2t9HOtrsLjXSPqKkmMrMtrmncb3xVzITPl0pu7mwESEjF1CooSkvtdTNPBW237K1bTNqyA9cD-opu_ISObWFLusFpAFJQk_tSxRAYi-mp4QI9fcXUUTYgndae?width=4248\u0026height=1324\u0026cropmode=none\" width=50% /\u003e\n\u003c/p\u003e\n\n\n- [**Fost**](#fost)\n- [Framework of Fost](#framework-of-fost)\n- [Quick Start](#quick-start)\n  - [Installation](#installation)\n  - [Train with FOST](#train-with-fost)\n- [Data Format](#data-format)\n- [Examples](#examples)\n- [Contact Us](#contact-us)\n\n\n# FOST\n\n\u003c!-- FOST is an easy-use forecasting tools aiming at spatial-temporal forecasting. --\u003e\nFOST(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.\n\n# Framework of FOST\n\nFollowing is the framework of FOST, basically it contains 4 main components:\n\n![FOST framework](https://dsm01pap002files.storage.live.com/y4mqv6c15r0vEfpNGcpMnUa4sOxYZFDDBL6h47EdLlVuKZcGTUw8LKrseJnZ2Q8hlJK3VB0lj13TJmF5pvrC5LeiKHR4cfSIGJT3YmV2D_-O6HpG8VFVKM5Alx9hEhAvc0fOAXFkthsC5qAccx8_eJsoKj8eTHvAns0z72v811JOVbswqGLWOeGNyUIjgQiL52F?width=1050\u0026height=268\u0026cropmode=none)\n\n| Module name   | Description                                                  |\n| ------------- | ------------------------------------------------------------ |\n| 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. |\n| 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. |\n| Fusion        | Fusion module aims at automatically select and ensemble model predictions. |\n| Utils         | There are many other utils in FOST, such as neural-network trainer and predictor, result plotter and so on. |\n\n# Quick Start\n\n## Installation\n\n### Installation of dependency packages\n\n#### 1. Prerequisites\n\nThis project relies on `pytorch \u003e= 1.8` and `torch-geometric \u003e= 1.7.2`\n\n- torch installation reference link：https://pytorch.org/get-started/previous-versions/\n\n- torch-geometric installation reference link: https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html\n\n#### 2. Installation\n\nYou can install fost with pip:\n\n```\npip install fostool\n```\n\n## Train with FOST\n\n#### 1. Import forecasting pipeline\n\n```python\nfrom fostool.pipeline import Pipeline\n```\n\n#### 2. Setting data path and lookahead\n\nYou need to pass your `train.csv` and `graph.csv` for model training, see [dataformat](#data-format) for data preparing.\n\n```python\ntrain_path = '/path/to/your/train.csv'\ngraph_path = '/path/to/your/graph.csv' # graph_path is alternative\nlookahead = 7 # Forward steps you would like to predict.\n```\n\n#### 3. Fit and predict\n\nWe provide a default config file in config/default.yaml. You could use your config file through config_path augment.\n\n```python\nfost = Pipeline(lookahead=lookahead, train_path=train_path, graph_path=graph_path)\nfost.fit()\nresult = fost.predict()\n```\n\n#### 4. Plot results\n\n```python\nfost.plot(result)\n```\n\n# Data Format\n\n\u003e You can fetch sample data on `/examples`\n\n### 1. train.csv\n\n3 columns are required for `train.csv`:\n\n+ Node: node name for current data\n+ Date: date or timestamp for current data\n+ TARGET: target for prediction\n\nA valid format may look like:\n\n| Node    | Date       | TARGET     |\n| ------- | ---------- | ---------- |\n| Alaska  | 1960-01-01 | 800592.0   |\n| Alaska  | 1961-01-01 | 933600.0   |\n| Alabama | 1960-01-01 | 10141633.0 |\n| Alabama | 1961-01-01 | 9885992.0  |\n| Alabama | 1962-01-01 | 10497917.0 |\n\nColumns except above will be regarded as feature columns.\n\n### 2. graph.csv (option)\n\n`graph.csv` should only contains 3 columns:\n\n+ node_0: node name for fist node, node name should align with node name in `train.csv`.\n+ node_1: node name for second node, node name should align with node name in `train.csv`.\n+ weight: weight on connection for node_0 to node_1.\n\nIf `graph.csv` is not provided, identity graph will be used.\n\n# Examples\nWe prepared several examples on `examples`:\n\n1. [Predict simulation cosine curve](/examples/1.%20Cosine%20prediction.ipynb)\n2. [Predict States Energy Data](/examples/2.%20Predict%20States%20Energy%20Data.ipynb)\n3. [Save and load model](/examples/3.%20Save%20and%20load.ipynb)\n\n# Contact Us\n\n- If you have any issues, please create issue [here](https://github.com/microsoft/fost/issues/new/choose) or send messages in [gitter](https://gitter.im/Microsoft/fost).\n- For other reasons, you are welcome to contact us by email([fostool@microsoft.com](mailto:fostool@microsoft.com)).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2FFOST","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2FFOST","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2FFOST/lists"}