# Time Series Prediction

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftime-series-prediction%2F25623%3E%5C
**Category:** 🤗Transformers\
**Created:** [November 6, 2022, 5:51am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftime-series-prediction%2F25623 "2022-11-06T05:51:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gianlab](https://avatars.discourse-cdn.com/v4/letter/g/7cd45c/32.png) [@gianlab](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fgianlab)%5C
**Post date:** [November 6, 2022, 5:51am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftime-series-prediction%2F25623%2F1 "2022-11-06T05:51:49Z")

</div>

Greetings,  
I would like to predict a time series via TimeSeriesTransformerForPrediction described here: [Time Series Transformer](https://huggingface.co/docs/transformers/model_doc/time_series_transformer) but I only got past\_values and future\_values and I get the error:

TypeError: forward () missing 4 required positional arguments: ‘past\_time\_features’, ‘past\_observed\_mask’, ‘static\_categorical\_features’, and ‘static\_real\_features’

Where am I wrong?

This is the code :

```auto
import torch
import torch.nn as nn

x_train = torch.from_numpy(x_train).type(torch.Tensor)
x_test = torch.from_numpy(x_test).type(torch.Tensor)
y_train = torch.from_numpy(y_train).type(torch.Tensor)
y_test = torch.from_numpy(y_test).type(torch.Tensor)

from transformers import TimeSeriesTransformerForPrediction

model = TimeSeriesTransformerForPrediction.from_pretrained(

    "huggingface/time-series-transformer-tourism-monthly"

)

# during training, one provides both past and future values

# as well as possible additional features

outputs = model(

    past_values=x_train,

    #past_time_features=None,

    #past_observed_mask=None,

    #static_categorical_features=None,

    #static_real_features=None,

    future_values=x_test,

    #future_time_features=None

)

loss = outputs.loss

loss.backward()

```

---

<div class="post-metadata">

**Author:** ![occam42](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/occam42/32/12511_2.png) [@occam42](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Foccam42)%5C
**Post date:** [November 11, 2022, 7:14pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftime-series-prediction%2F25623%2F2 "2022-11-11T19:14:44Z")

</div>

it looks like all of the columns mentioned in the error message have to be provided, have you tried providing some dummy values like in batch example?
