• Stars
    star
    270
  • Rank 151,321 (Top 3 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Unofficial Implementation of RobustSTL: A Robust Seasonal-Trend Decomposition Algorithm for Long Time Series (AAAI 2019)

RobustSTL: A Robust Seasonal-Trend Decomposition Algorithm for Long Time Series (AAAI 2019)

This repository contains python (3.5.2) implementation of RobustSTL (paper) .

Decomposing complex time series into trend, seasonality, and remainder components is an important task to facilitate time series anomaly detection and forecasting.
RobustSTL extract trend using LAD loss with sparse regularization and non-local seasonal filtering.
Compared to previous approaches (such as traditional STL), RobustSTL has advantages on

  1. Ability to handle seasonality fluctuation and shift, and abrupt change in trend and reminder
  2. robustness of data with anomalies
  3. applicability on time series with long seasonality period.

Requirments & Run

First, install some required libraries using pip.

pip3 install -r requirments.txt
python3 main.py

Sample Results

We generate a synthetic sample (sample_generator.py) and decompose it into trend, seasonality, and remainder. In run_example.ipynb, I attach the example codes to use RobustSTL and the outputs.

Codes

  • main.py : run example code
  • RobustSTL.py: contains RobustSTL algorithm and each process.
  • utils.py: common utility functions
  • sample_generator.py: generation codes of synthetic sample.
  • l1.py : optimizer of l1 norm approximation (source: cvxopt)

Arugments of RobustSTL

  • input : input series
  • season_len : length of seasonal period
  • reg1 : first order regularization parameter for trend extraction
  • reg2 : second order regularization parameter for trend extraction
  • K : number of past season samples in seasonality extraction
  • H : number of neighborhood in seasonality extraction
  • dn1, dn2 : hyperparameter of bilateral filter in denoising step.
  • ds1, ds2 : hyperparameter of bilarteral filter in seasonality extraction step.

Shape of input sample

Basically, RobustSTL is for univariate time series sample.
However, this codes are available on multi-variate time series sample. (It apply the algorithm to each series, using multiprocessing) Each series have to have same time length.

  • Univariate Time Series: [Time] or [Time,1]
  • Multivariate Time Series: [N, Time] or [N, Time, 1]

Etc

The original paper has wrong notation in seasonality extraction.
The difference is log

More Repositories

1

AnoGAN-tf

Unofficial Tensorflow Implementation of AnoGAN (Anomaly GAN)
Python
272
star
2

FixMatch-pytorch

Unofficial Pytorch code for "FixMatch: Simplifying Semi-Supervised Learning with Consistency and Confidence" in NeurIPS'20. This repo contains reproduced checkpoints.
Python
190
star
3

DeblurGAN-tf

Unofficial tensorflow (tf) implementation of DeblurGAN: Blind Motion Deblurring Using Conditional Adversarial Networks
Python
68
star
4

TGGNet-keras

Official implementation of Temporal-Guided Networks
Jupyter Notebook
48
star
5

bottom-up-attention-tf

Unofficial tensorflow implementation of "Bottom-up and Top-down attention for VQA" (TF v. 1.13)
Python
39
star
6

Deep-Learning-Tensorflow-Basic

Seminar Materials
Jupyter Notebook
13
star
7

CapsNet-tf

Unofficial implementation of Capsule Networks, Dynamic Routing between capsules (by tensorflow)
Python
11
star
8

Anomaly-Detection-with-K-means

Python
8
star
9

Contrastive_Regularization_for_SSL

Official Pytorch Implementation of "Contrastive Regularization for Semi-Supervised Learning"
8
star
10

Gaussian-Process-Gpy

Gaussian Process Regression with Gpy
Jupyter Notebook
7
star
11

Layer-Recurrent-Neural-Networks-LRNN-tf

Layer Recurrent Neural Network-LRNN-tensorflow-tf
Python
5
star
12

awesome-active-learning

To be released !
3
star
13

Blast_Furnace_Diagonosis

Python
2
star
14

Graph-Convolutional-Networks

related model with GCN
Jupyter Notebook
2
star
15

ML_Implementations

Jupyter Notebook
2
star
16

Anomaly_Detection_VQA

Official implementation of "Regularizing Attention Networks for Anomaly Detection in VQA"
2
star