Code Monkey home page Code Monkey logo

generate-time-series's Introduction

Synthetic time series generation for training simple multi-layer-perceptron classifier

This project explores using dynamic-time-warping (DTW) and Stochastic Subgradient averaging (SSG) for synthetic time-series data generation.

See the general overview of methods and evaluation.

To test the scripts, download UCR dataset in the same folder as the scripts.

Use python3 and install required packages: pip3 install -r requirements.txt

To use the scripts with your own data, use the expand_data_set function in spawn.py.

generate new dataset

Generate new data points for given data set.

$ python3 spawn.py -h
usage: spawn.py [-h] [-d DATASETNAME] [-r N_REPS] [-b N_BASE] [-k K]
                [-s SSG_EPOCHS] [-i INPUT_SUFFIX] [-o OUTPUT_SUFFIX]

optional arguments:
  -h, --help            show this help message and exit
  -d DATASETNAME, --datasetname DATASETNAME
                        Datasetname (=foldername in UCR folder)
  -r N_REPS, --n_reps N_REPS
                        Number of iterations for the complete procedure
  -b N_BASE, --n_base N_BASE
                        Number of data-points to average for creating one new
                        data-point
  -k K, --k K           Number of iterations for K-means clustering
  -s SSG_EPOCHS, --ssg_epochs SSG_EPOCHS
                        Number of iterations for mean calculation with SSG
  -i INPUT_SUFFIX, --input_suffix INPUT_SUFFIX
                        suffix for file to be extended
  -o OUTPUT_SUFFIX, --output_suffix OUTPUT_SUFFIX
                        suffix for created training and test files

$ python3 spawn.py --datasetname=str --n_rep=int --n_base=int --k=int --ssg_epochs=int --input_suffix=str --output_suffix=str
# Example
$ python3 spawn.py --datasetname=InlineSkate --n_reps=10 --n_base=2 --k=1 --ssg_epochs=1 --input_suffix=TRAIN --output_suffix=EXP_TRAIN
# or short:
$ python3 spawn.py -d=InlineSkate -r=10 -b=2 -k=1 -s=1 -i=TRAIN -o=EXP_TRAIN

resplit dataset

Resplit the training and test set to a given ratio

$ python3 resplit.py -h
usage: resplit.py [-h] [-d DATASETNAME] [-r RATIO] [-o OUTPUT_SUFFIX]

optional arguments:
  -h, --help            show this help message and exit
  -d DATASETNAME, --datasetname DATASETNAME
                        Datasetname (=foldername in UCR folder)
  -r RATIO, --ratio RATIO
                        New ratio of training and test dataset
  -o OUTPUT_SUFFIX, --output_suffix OUTPUT_SUFFIX
                        Suffix for training and test files created

$ python3 resplit.py --datasetname=str --ratio=float --input_suffix=str
# Example
$ python3 resplit.py --datasetname=ArrowHead --ratio=.7 --input_suffix=_ALT70
# or short:
$ python3 resplit.py -d=ArrowHead -r=.7 -i=_ALT70

generate-time-series's People

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.