Giter Club home page Giter Club logo

hts-constrained-embeddings's Introduction

hts-constrained-embeddings

This repository contains code to reproduce the experiments in "Forecasting Hierarchical Time Series with a Regularized Embedding Space" from the 6th Workshop on Mining and Learning from Time Series at KDD '20.

Data

The Australian travel flow data used in experiments can be downloaded here: https://robjhyndman.com/publications/mint/.

Experiments

Run the experiment.py script with the following flags to reproduce experiments:

  1. Initial Experiment:

    1. python experiment.py reproduce --metrics_file='data/metrics/baseline.txt' --output_path='data/preds_baseline' --serialize_path='data/models_baseline' --reconciled_path='data/reconciled_preds_baseline'

    2. in R: reconcile_all(in_dir = 'preds_baseline', out_dir = 'reconciled_preds_baseline')

    3. python experiment.py optimal_reconciliation --metrics_file='data/metrics/baseline.txt' --output_path='data/preds_baseline' --serialize_path='data/models_baseline' --reconciled_path='data/reconciled_preds_baseline'

  2. Short Training Sequences:

    1. python experiment.py reproduce --train_size=54 --metrics_file='data/metrics/small.txt' --output_path='data/preds_small' --serialize_path='data/models_small' --reconciled_path='data/reconciled_preds_small'

    2. in R: reconcile_all(in_dir = 'preds_small', out_dir = 'reconciled_preds_small')

    3. python experiment.py optimal_reconciliation --train_size=54 --metrics_file='data/metrics/small.txt' --output_path='data/preds_small' --serialize_path='data/models_small' --reconciled_path='data/reconciled_preds_small'

  3. Long Forecast Horizon:

    1. python experiment.py reproduce --horizon=24 --metrics_file='data/metrics/horizon.txt' --output_path='data/preds_horizon' --serialize_path='data/models_horizon' --reconciled_path='data/reconciled_preds_horizon'

    2. in R: reconcile_all(in_dir = 'preds_horizon', out_dir = 'reconciled_preds_horizon', horizon = 24)

    3. python experiment.py optimal_reconciliation --horizon=24 --metrics_file='data/metrics/horizon.txt' --output_path='data/preds_horizon' --serialize_path='data/models_horizon' --reconciled_path='data/reconciled_preds_horizon'

  4. Relative Embedding Dimension: 0.5: python experiment.py reproduce --embed_dim_ratio=0.5 --metrics_file='data/metrics/edim05.txt' --output_path='data/preds_edim05' --serialize_path='data/models_edim05' --reconciled_path='data/reconciled_preds_edim05'

  5. Relative Embedding Dimension: 2: python experiment.py reproduce --embed_dim_ratio=2 --metrics_file='data/metrics/edim2.txt' --output_path='data/preds_edim2' --serialize_path='data/models_edim2' --reconciled_path='data/reconciled_preds_edim2'

  6. Relative Embedding Dimension: 4: python experiment.py reproduce --embed_dim_ratio=4 --metrics_file='data/metrics/edim4.txt' --output_path='data/preds_edim4' --serialize_path='data/models_edim4' --reconciled_path='data/reconciled_preds_edim4'

Plots

Run the plot.py script with the following flags to reproduce plots. Experiments must first be run and log data must be downloaded from tensorboard.

  1. Initial Experiment: python plot.py --fig_title='baseline'

  2. Short Training Sequences: python plot.py --fig_title='small'

  3. Long Forecast Horizon: python plot.py --fig_title='horizon'

hts-constrained-embeddings's People

Contributors

jlgleason avatar

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.