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.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for serieset-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 360b0cfdad93f18e80a9b0659b19f7ba766ac1a3effd2e8090af580848bf1748
MD5 d4ceb146890f5f5e66073e74109c9409
BLAKE2b-256 9c43cb963bea2b72e7f0f0f5f046f366494c300b8097503ea45dcab981381f78

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