Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError: Time difference between steps has been idenfied as larger than 1 - set allow_missing_timesteps=True #1760

Open
sathmikaDev opened this issue Jan 26, 2025 · 1 comment

Comments

@sathmikaDev
Copy link

train_dataset = TimeSeriesDataSet(
    Final_DF[lambda x: x.time_idx <= training_cutoff],
    time_idx="time_idx",
    target="target",
    group_ids=["group_id"],
    max_encoder_length=max_encoder_length,
    min_encoder_length=max_encoder_length//2, 
    max_prediction_length=max_prediction_length,
    min_prediction_length=max_prediction_length,
    static_reals=[],  # Add any static features like group-level metadata
    time_varying_known_reals=[
        "time_idx",
        "Dollar_Index",
        "Gold_Price",
        "Interest_Rate",
        "US_10_Year",
        "VIX_Value",
        "month",
        "day_of_week",
        "year",
        "month",
        "day_of_year",
        "quarter",
    ],
    time_varying_unknown_categoricals=[],
    time_varying_unknown_reals=["target", "lag_1", "lag_3", "lag_7", "ma_3", "ma_7"],
    target_normalizer=GroupNormalizer(
        groups=["group_id"], transformation="softplus"
    ),
    add_relative_time_idx=True,
    add_target_scales=True,
    add_encoder_length=True,
)

# create validation set (predict=True) which means to predict the last max_prediction_length points in time
# for each series
validation = TimeSeriesDataSet.from_dataset(training, Final_DF, predict=True, stop_randomization=True)

# create dataloaders for model
batch_size = 128  # set this between 32 to 128
train_dataloader = training.to_dataloader(train=True, batch_size=batch_size, num_workers=0)
val_dataloader = validation.to_dataloader(train=False, batch_size=batch_size * 10, num_workers=0)

I'm trying to build a TFT model to predict cryptocurrency prices which is generalized across multiple cryptocurrencies. I'm having this AssertionError when creating the dataset.

Image

Image

here I have attached my what my dataset looks like.

@Sohaib-Ahmed21
Copy link
Contributor

@sathmikaDev you have not mentioned which AssertionError are you specifically getting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants