#5671·autogluon

[timeseries] Preserve custom id_column/timestamp_column names in predict() output

Author: ZabinskiMichalCreated May 18, 2026Updated Jul 20, 2026
Labelsenhancementmodule: timeseries

Description

Module: timeseries

Problem

TimeSeriesDataFrame accepts custom column names on input via id_column and timestamp_column (e.g. from_data_frame(..., id_column="product", timestamp_column="time")). Columns are renamed internally to canonical names item_id and timestamp, which is reasonable for internal consistency.

However, the original column names are not stored and are not restored on output. In particular:

  • TimeSeriesPredictor.predict() always returns a TimeSeriesDataFrame with MultiIndex levels named item_id and timestamp.
  • TimeSeriesPredictor.make_future_data_frame() always returns columns item_id and timestamp.
  • TimeSeriesDataFrame.to_data_frame() reflects the canonical index names as well.

This creates a mismatch for users whose upstream/downstream pipelines use custom schema names (databases, ETL, reporting). The forecasting tutorial states that raw column names "can be arbitrary" when constructing a TimeSeriesDataFrame, which can imply end-to-end preservation, but the docs do not mention that outputs always use canonical names.

Current behavior (minimal example)

python
import pandas as pd
from autogluon.timeseries import TimeSeriesDataFrame, TimeSeriesPredictor

df = pd.DataFrame({
    "product": ["A", "A", "A"],
    "time": pd.to_datetime(["2020-01-01", "2020-01-02", "2020-01-03"]),
    "target": [1.0, 2.0, 3.0],
})

train_data = TimeSeriesDataFrame.from_data_frame(
    df, id_column="product", timestamp_column="time"
)
assert train_data.index.names == ["item_id", "timestamp"]  # expected internal normalization

predictor = TimeSeriesPredictor(prediction_length=1, freq="D").fit(train_data)
predictions = predictor.predict(train_data)

print(predictions.index.names)
# Actual:   ['item_id', 'timestamp']
# Desired:  ['product', 'time']  (or configurable)

References