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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file serieset-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: serieset-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f65521dd48b483d84d2e217a13ff6d3688cc1215748374da9e66a0b99e222c6 |
|
MD5 | 3ecee027a8d0a1b42e40fb1f5a3e62b0 |
|
BLAKE2b-256 | 705b1b8c367528a3de6fcc2f7682c9d058a867982619b4dfb74f9e2cc453e590 |