<file_sep>from setuptools import setup

setup(
    name="TimeSeriesD3MWrappers",
    version="1.2.0",
    description="Two forecasting primitives: Vector Autoregression and Deep Autoregressive forecasting. Two classification primiives: KNN and LSTM FCN with attention",
    packages=["TimeSeriesD3MWrappers"],
    install_requires=[
        "numpy>=1.15.4,<=1.17.3",
        "scipy>=1.2.1,<=1.3.1",
        "scikit-learn[alldeps]>=0.20.3,<=0.21.3",
        "pandas>=0.23.4,<=0.25.2",
        "tensorflow-gpu == 2.0.0",
        "tslearn == 0.2.5",
        "statsmodels==0.10.2",
        "pmdarima==1.0.0",
        "deepar @ git+https://github.com/NewKnowledge/deepar@d06db4f6324ab8006c9b4703408ce3b6ae955cf4#egg=deepar-0.0.2",
    ],
    entry_points={
        "d3m.primitives": [
            "time_series_classification.k_neighbors.Kanine = TimeSeriesD3MWrappers.primitives.classification_knn:Kanine",
            "time_series_forecasting.vector_autoregression.VAR = TimeSeriesD3MWrappers.primitives.forecasting_var:VAR",
            "time_series_classification.convolutional_neural_net.LSTM_FCN = TimeSeriesD3MWrappers.primitives.classification_lstm:LSTM_FCN",
            "time_series_forecasting.lstm.DeepAR = TimeSeriesD3MWrappers.primitives.forecasting_deepar:DeepAR",
        ],
    },
)
<file_sep>#!/bin/bash -e

Paths=('d3m.primitives.time_series_classification.k_neighbors.Kanine' 'd3m.primitives.time_series_forecasting.vector_autoregression.VAR' 'd3m.primitives.time_series_forecasting.lstm.DeepAR' 'd3m.primitives.time_series_classification.convolutional_neural_net.LSTM_FCN')
for i in "${Paths[@]}"; do
  cd /primitives/v2019.11.10/Distil
  cd $i
  echo $i
  cd *
  python3 -m d3m index describe -i 4 $i > primitive.json
done
<file_sep># Repository of D3M wrappers for time series classification and forecasting

**TimeSeriesD3MWrappers/primitives**: 

D3M primitives

1. **classification_knn.py**: wrapper for tslearn's KNeighborsTimeSeriesClassifier algorithm 

2. **classification_lstm.py**: wrapper for LSTM Fully Convolutional Networks for Time Series Classification paper, original repo (https://github.com/titu1994/MLSTM-FCN), paper (https://arxiv.org/abs/1801.04503)

3. **forecasting_deepar.py**: wrapper for DeepAR recurrent, autoregressive Time Series Forecasting algorithm (https://arxiv.org/abs/1704.04110). Custom implementation repo (https://github.com/NewKnowledge/deepar)

4. **forecasting_var.py**: wrapper for **statsmodels**' implementation of vector autoregression for multivariate time series

**TimeSeriesD3MWrappers/pipelines**: 

Example pipelines for primitives. Latest are: 

1. **forecasting_pipeline_imputer.py**: pipeline for DeepAR primitive on all forecasting datasets

2. **forecasting_pipeline_var.py**: pipeline for VAR primitive on all forecasting datasets (except terra datasets)

3. **Kanine_pipeline.py**: pipeline for Kanine primitive on all classification datasets

4. **LSTM_FCN_pipeline.py**: pipeline for LSTM_FCN primitive on all classification datasets

Model utils

1. **layer_utils.py**: implementation of AttentionLSTM in tensorflow (compatible with 2), originally from https://github.com/houshd/LSTM-FCN

2. **lstm_model_utils.py**: functions to generate LSTM_FCN model architecture and data generators

3. **var_model_utils.py**: wrapper of the **auto_arima** method from **pmdarima.arima** with some specific parameters fixed





