Skip to main content

Multi Time Series Encoders

Project description

Multi Time Series Encoders

The objective of this python package is to make easy the encoding and the classification/regression of multivariate time series (mts) data even when these are asynchronous. We say that data are of type mts when each observation is associated with multiple time series (e.g. the vital signs of a patient at a specific period).

Installation

The current version has been developed in Python 3.7. It also works in Python 3.8. If you encounter an issue, please try to run it again in a virtual machine containing Python 3.7 or 3.8.

pip install mtse

Sample code

import mtse

### Load sample data ###
train, val, test, norm = mtse.get_sample(return_norm=True)

### Using the class `mtse` ###
mtan = mtse.mtse(device='cuda', seed=1, experiment_id='mtan')
mtan.load_data(train, val, test, norm=norm)
mtan.build_model('mtan', 'regression', learn_emb=True, early_stop=10)
mtan.train(cuda_empty_cache=True, lossf='mape', n_iters=200, save_startegy='best')
mtan.predict(checkpoint='best')

### Using the funcion `run_model` ###
mtse.run_model(train_data = train, val_data = val, test_data=test, predict_strategy='last', 
               save_strategy=None, optim='default', sched='default', seed=11, n_iters=100, 
               lossf='mse', device='cuda', batch_size=128, early_stop=5, encoder='mtan')

More details and examples in the documentation

What can be implemented / improved

Encoders

  • mTAN - Multi Time Attention Network - encoder
  • mTAN - Multi Time Attention Network - encoder-decoder
  • SeFT - Set Function for Time series
  • STraTS - Self-supervised Transformer for Time-Series
  • ODE-based encoders

Note that we only implemented the mTAN encoder as a baseline for now. At this stage, this model works only for supervised learning, meaning that it uses the target variable to compute the loss and update the encoder weights. Thus, the priority would be to implement an unsupervised encoder next (encoder-decoder models or self-supervised encoders).

Other features

  • Cross-validation evaluation, prediction and encoding
  • Support for other data inputs in the dataset classes (currently the mtan_Dataset class)
  • Support for time-series forecasting and inference tasks

References

Satya Narayan Shukla and Benjamin Marlin, "Multi-Time Attention Networks for Irregularly Sampled Time Series", International Conference on Learning Representations, 2021.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mtse-0.1.1.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

mtse-0.1.1-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file mtse-0.1.1.tar.gz.

File metadata

  • Download URL: mtse-0.1.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

File hashes

Hashes for mtse-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9365fd25bf75507c5030ff10225e8ffe21511ddb94840a4404285aad099003d0
MD5 9faf44e8eca03d6b6f9dd2ed008cdfaf
BLAKE2b-256 303e1ed2b1802e6087af569a185702dc84959c5e4dcd430c6b986db487c5c22f

See more details on using hashes here.

File details

Details for the file mtse-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mtse-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

File hashes

Hashes for mtse-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ca50a4c20125b88b1d1c263e2a0d3740dd4db2ae2c06665173a124df7052c34
MD5 0b8ae8e3bfd15c7b4ff76961d2ce21f9
BLAKE2b-256 99dbeab00b5317fcbdd435d02e250543f1f00823d11060864a1d1efc9590dd2a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page