Skip to main content

Easy Time Series Dataset with PyTorch.

Project description

SerieSet: Easy Time Series Dataset with PyTorch

💡 What's SerieSet?

We need an easy and (relatively) general dataset builder for time series model training. This project only relies on PyTorch, Pandas, and Numpy.

⬇️ Installation

pip install serieset

</> API details

data (pandas.DataFrame): dataframe with single or multiple time series, group_id, date_col, target_col columns are expected, features columns are optional.

inp_len (int): input sequence length. i.e. 96.

pred_len (int): prediction sequence length. i.e. 14.

target_col (str): target time series column name (i.e., airport volume, store sales).

date_col (str): date column name. i.e. "date".

group_id (Union[str, List[str]]): group id column name. i.e. "store_name" or ["store_name", "product_id"].

features (Optional[Union[str, List[str]]]): feature column name. i.e. "volume" or ["volume", "price"]. All features should be numeric.

train_val_split_date (str): date for train-validation split. i.e. "2019-01-01". Default is None. If 'last', the last inp_len + pred_len data will be used for validation.

dtype (str): data type of torch data tensor. Default is "float32".

mode (str): train or validation.

💡 Example

import pandas as pd
from serieset import TimeSeriesDataset

data = pd.read_csv("./data/ETTh1.csv")
data["group_id"] = "ETTh1"

print(data.head())
print(f"minimum date: {data['date'].min()}")
print(f"maximum date: {data['date'].max()}")

params = {
    'target_col': 'OT',
    'features': ["HUFL", "HULL"],
    'group_id': 'group_id',
    'date_col': 'date',
    'inp_len': 36,
    'pred_len': 12,
    'train_val_split_date': '2018-01-01 00:00:00',
    'mode': 'train',
}

torch_dataset = TimeSeriesDataset(
    data=data,
    **params
)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

serieset-0.1.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: serieset-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for serieset-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 80a3d9a0e2a75603ee559c5969065649115c8f9e93a354018099435e59f31960
MD5 47e1f9092821204219b6ff6b548ac4a5
BLAKE2b-256 cfcbc33b8b8bacfb9f82f6e7cd3a65cd57d6e8c6e1811a99aab9a11f40732335

See more details on using hashes here.

Supported by

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