Skip to main content

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, cuda_empty_cache=True)
mtan.train(lossf='mape', n_iters=200, save_startegy='best')
mtan.predict(checkpoint='best')
mtan.encode_ts(data_to_embed='test', embed_pandas=True)

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.

Release files for mtse 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mtse 0.1.6
File Size Uploaded
mtse-0.1.6.tar.gz 15.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mtse 0.1.6
File Interpreter ABI Platform
mtse-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 1.7 MB

Release files / mtse-0.1.6.tar.gz

Download URL mtse-0.1.6.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a72c331177826da7c71be586957f9ac4b07933bc14064d9ffe8eb33dd1e6c6f7
BLAKE2b-256 checksum
How to use checksums
7fe283c5b6608acfaa38c6853d19cc5871f5409d3a8e89425b28f36443dcb077
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Release files / mtse-0.1.6-py3-none-any.whl

Download URL mtse-0.1.6-py3-none-any.whl
Size 1.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
06d9083f9ee3ee5c282bab9e1393a6e25d583f1892f0bf837f7702a8a4def26b
BLAKE2b-256 checksum
How to use checksums
255397591546b440c644220e2dc672b76811ff9b5254ba798d94a2859759e3b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page