Datasets:
Dataset Viewer
The dataset viewer is not available for this dataset.
Unexpected token '<', "<html>
<h"... is not valid JSON
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
next-purchase-day — TsFile
This dataset is a conversion of the HuggingFace dataset
alexgrigoras/next-purchase-day
to the Apache TsFile format. The original CSV
files are also kept here, as in the source repository.
Original dataset
- Source dataset: alexgrigoras/next-purchase-day
- Content: a GluonTS-format purchase time-series — 34 users (
item_id) per split, each with a sequence of purchase times (target, seconds-of-day). Three splits: train / validation / test.
What is in this repository
data/
├── train.tsfile # converted (TsFile)
├── validation.tsfile
└── test.tsfile
df_purchases_train.csv # original CSVs, copied verbatim
df_purchases_validation.csv
df_purchases_test.csv
TsFile storage mapping (table model, per split)
| Role | Column | Type | Notes |
|---|---|---|---|
| TAG | item_id |
STRING | 34 users → 34 devices |
| Time | within-series position index | INT64 | 0, 1, 2, … per series |
| FIELD | target |
INT32 | purchase second-of-day (integer, 0..86340) |
| FIELD | feat_static_cat_0 |
INT64 | per-series static category |
Conversion notes
- GluonTS nested rows expanded to a long table: each source row is one sequence
(start, target[], item_id, feat_static_cat[1], feat_dynamic_real); thetargetarray is exploded so each point becomes one row. - Three splits → three separate TsFiles (train / validation / test); the original split is preserved, not merged.
- TAG =
item_id(34 devices). Time = within-series position index (0, 1, 2, …). The sourcestartfield is a1970-01-01placeholder (not a real timestamp), so the ordinal index is used as the time axis. feat_static_cat→feat_static_cat_0(INT64, the single static category).- Dropped (with consent):
feat_dynamic_real— entirely null across all splits (an empty column carrying no information). No rows dropped (train 2,448 / validation 2,584 / test 2,720 points, matching the source exactly). - The original CSVs (
df_purchases_{train,validation,test}.csv) are kept verbatim.
Usage
from tsfile import TsFileReader
reader = TsFileReader("data/train.tsfile")
schemas = reader.get_all_table_schemas()
tname = next(iter(schemas))
cols = ["item_id", "target", "feat_static_cat_0"]
with reader.query_table(tname, cols, batch_size=65536) as rs:
while (batch := rs.read_arrow_batch()) is not None:
df = batch.to_pandas()
# ... process ...
reader.close()
Citation
@misc{next_purchase_day,
title = {next-purchase-day},
author = {alexgrigoras},
url = {https://huggingface.co/datasets/alexgrigoras/next-purchase-day},
publisher = {Hugging Face}
}
The source HuggingFace dataset does not declare an explicit license.
- Downloads last month
- 80