app_flow / README.md
wangdx25's picture
Add TsFile (converted from kashif/App_Flow)
0eef7fc verified
|
Raw
History Blame Contribute Delete
2.32 kB
---
license: apache-2.0
task_categories:
- time-series-forecasting
tags:
- tsfile
- format:tsfile
- timeseries
modality: timeseries
configs:
- config_name: default
data_files:
- split: train
path: app_flow.tsfile
---
# App Flow
This dataset consists of hourly maximum traffic flow for 128 systems deployed on 16 logic data centers, resulting in 1083 different time series in total.
The length of each series is more than 4 months. Each time series is divided into two segments for training and testing with a ratio of 32:1.
This dataset was collected at Ant Group and does not contain any Personal Identifiable Information and is desensitized and encrypted.
## TsFile Conversion
- Original dataset: [`kashif/App_Flow`](https://huggingface.co/datasets/kashif/App_Flow)
- Modalities: Time-series
- Converted data files are listed in the YAML metadata above.
- Source README text and dataset-specific metadata are retained; the source
Usage section is replaced with the executable TsFile Python SDK example below.
- The encrypted source CSV is decoded as provided; `app_name` and `zone` are TAG columns, `time` becomes millisecond `Time`, and only the pandas export index is removed.
- Rows are stably sorted by `app_name`, `zone`, and `Time`; duplicate or otherwise too-close timestamps within one device receive the smallest deterministic millisecond offsets needed for a strictly increasing TsFile timeline.
## Usage
Install the Apache TsFile Python SDK (`pip install tsfile`) and read a converted file:
```python
from pathlib import Path
from tsfile import TsFileReader
path = Path("app_flow.tsfile")
with TsFileReader(str(path)) as reader:
schemas = reader.get_all_table_schemas()
print("tables:", list(schemas))
table_name = next(iter(schemas))
table = schemas[table_name]
columns = [column.get_column_name() for column in table.get_columns()]
print("columns:", columns)
field_names = [
column.get_column_name()
for column in table.get_columns()
if column.get_column_name() not in {"Time", "time"}
]
if field_names:
with reader.query_table(table_name, field_names[:3], batch_size=1024) as result:
batch = result.read_arrow_batch()
if batch is not None:
print(batch.to_pandas().head())
```