Giter Club home page Giter Club logo

Comments (5)

lostella avatar lostella commented on June 8, 2024

@ArianKhorasani you can use triple backticks to better highlight code sections, error traces, etc. See https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks

The TransformerEstimator only supports univariate data.

from gluonts.

ArianKhorasani avatar ArianKhorasani commented on June 8, 2024

Thanks @lostella - I have another question. I checked the multivariate models by GluonTS and found out that GPVAREstimator is able to handle multivariate time series data and I wrote the following code to train my data on it:

```
estimator = GPVAREstimator(
    prediction_length=prediction_length, 
    target_dim=len(vital_signs),
    freq='1H',
    trainer=Trainer(epochs=5, num_batches_per_epoch=50),
)
predictor = estimator.train(training_data=train_ds)
```

but now, I do get the following error:

**Exception: Reached maximum number of idle transformation calls.
This means the transformation looped over 423 inputs without returning any output.
This occurred in the following transformation:
gluonts.transform.split.InstanceSplitter(dummy_value=0.0, forecast_start_field='forecast_start', future_length=1, instance_sampler=ExpectedNumInstanceSampler(axis=-1, min_past=173, min_future=1, num_instances=1.0, total_length=0, n=0), is_pad_field='is_pad', lead_time=0, output_NTC=True, past_length=173, start_field='start', target_field='target', time_series_fields=['time_feat', 'observed_values'])**

from gluonts.

lostella avatar lostella commented on June 8, 2024

That usually arises when many of the series in the training data are too short to be able to extract meaningful training examples. Based on your error, it seems like the training procedure is trying to extract windows with 173 past observations, and 1 future observation. Are your series all shorter than 174 by any chance?

from gluonts.

ArianKhorasani avatar ArianKhorasani commented on June 8, 2024

Dear @lostella - Yes, Here is the output of the length of each time series in the dataset:

```
[109, 15, 9, 15, 16, 11, 1, 15, 5, 7, 17, 5, 4, 40, 7, 7, 3, 13, 11, 7, 5, 8, 18, 10, 12, 25, 5, 5, 5, 3, 3, 9, 9, 20, 2, 3, 15, 2, 10, 24, 7, 17, 8, 16, 4, 10, 11, 10, 9, 15, 9, 7, 14, 10, 3, 3, 20, 11, 7, 9, 18, 8, 11, 13, 9, 3, 7, 11, 62, 5, 8, 23, 21, 5, 15, 16, 14, 11, 5, 6, 7, 5, 12, 2, 12, 3, 6, 5, 12, 16, 15, 6, 5, 12, 17, 20, 24, 7, 29, 18, 9, 5, 9, 11, 13, 6, 21, 6, 8, 24, 3, 3, 12, 5, 4, 4, 1, 1, 32, 31, 5, 3, 9, 28, 52, 13, 9, 18, 13, 1, 6, 6, 44, 9, 9, 9, 5, 7, 9, 10, 6, 15, 13, 8, 6, 11, 4, 13, 3, 21, 12, 18, 23, 17, 8, 14, 6, 18, 20, 13, 9, 35, 9, 7, 8, 4, 11, 15, 4, 7, 9, 10, 13, 9, 17, 25, 30, 9, 9, 5, 8, 13, 5, 5, 18, 9, 12, 9, 45, 10, 18, 9, 35, 4, 9, 4, 4, 3, 13, 11, 2, 4, 5, 8, 7, 14, 19, 38, 3, 2, 11, 4, 6, 10, 6, 25, 7, 3, 6, 9, 7, 9, 15, 14, 7, 3, 3, 1, 11, 9, 8, 6, 11, 10, 13, 6, 23, 42, 3, 9, 5, 5, 11, 5, 13, 4, 10, 4, 8, 10, 1, 11, 15, 3, 9, 12, 6, 12, 31, 6, 3, 2, 4, 4, 21, 9, 9, 10, 8, 5, 11, 8, 20, 2, 5, 8, 6, 12, 11, 13, 10, 9, 13, 5, 7, 4, 15, 3, 23, 15, 4, 8, 3, 7, 9, 41, 11, 9, 11, 10, 7, 3, 4, 4, 1, 7, 10, 3, 5, 2, 21, 10, 7, 12, 6, 6, 8, 5, 9, 12, 12, 4, 31, 8, 8, 9, 4, 8, 6, 8, 6, 3, 4, 20, 13, 5, 4, 8, 18, 19, 11, 8, 13, 6, 4, 5, 6, 11, 2, 9, 20, 11, 11, 5, 2, 1, 23, 10, 7, 11, 12, 4, 11, 21, 2, 13, 11, 9, 13, 6, 8, 4, 6, 29, 11, 13, 10, 9, 12, 1, 11, 10, 6, 9, 19, 8, 4, 5, 13, 2, 8, 3, 13, 11, 8, 25, 11, 4, 7, 32, 3, 11, 14, 13, 19, 7, 16, 6, 7, 15, 5, 8, 3, 21, 17, 10, 18, 3, 10, 12, 10, 7, 10, 3, 3, 3, 20, 6, 10, 13, 4, 3, 19, 2, 21, 12, 5, 4, 4, 6, 15, 1, 13, 3, 5, 5, 5, 9, 32, 15, 5, 2, 7, 14, 4, 6, 9, 9, 10, 12, 9, 12, 13, 5, 8, 6, 5, 9, 1, 14, 22, 12, 11, 1, 10, 14, 3, 17, 3, 5, 15, 9, 3, 8, 3, 3, 4, 7, 6, 2, 3, 3, 14, 7, 3, 19, 5, 9, 1, 9, 6, 10, 3, 7, 12, 18, 15, 5, 10, 10, 6, 12, 18, 1, 5, 4, 8, 11, 1, 3, 3, 3, 6, 8, 11, 9, 4, 13, 11, 2, 2, 12, 13, 5, 5, 5, 9, 11, 1, 7, 9, 9, 5, 5, 3, 15, 5, 5, 15, 1, 5, 10, 4, 12, 17, 5, 8, 3, 3, 11, 3, 13, 13, 12, 3, 38, 5, 5, 15, 5, 6, 4, 4, 4, 15, 7, 11, 8, 3, 4, 6, 15, 11, 6, 5, 24, 12, 11, 6, 7, 2, 7, 4, 9, 34, 8, 11, 4, 26, 12, 24, 3, 4, 6, 2, 8, 1, 4, 7, 7, 9, 6, 10, 12, 8, 3, 21, 3, 11, 4, 4, 5, 12, 17, 5, 5, 16, 17, 11, 20, 3, 5, 7, 43, 20, 31, 4, 13, 9, 17, 3, 7, 2, 11, 15, 14, 5, 12, 16, 9, 7, 8, 10, 23, 13, 6, 6, 9, 5, 4, 6, 9, 39, 26, 6, 3, 6, 7, 8, 4, 5, 10, 1, 8, 3, 14, 8, 16, 3, 6, 10, 3, 5, 13, 3, 37, 7, 9, 8, 8, 8, 4, 6, 9, 13, 6, 15, 20, 8, 23, 11, 37, 5, 4, 4, 1, 15, 10, 13, 4, 2, 3, 5, 11, 7, 8, 7, 4, 5, 4, 5, 5, 8, 6, 2, 1, 13, 1, 11, 7, 9, 10, 6, 7, 10, 146, 8, 7, 10, 8, 21, 8, 12, 3, 15, 12, 14, 2, 3, 3, 43, 20, 5, 11, 8, 5, 2, 11, 22, 10, 4, 11, 9, 11, 13, 3, 45, 13, 5, 7, 11, 5, 10, 3]

```

Please note that the context_length I have is equal to 5, and the prediction_length is equal to 1. Since the goal of this task is to predict the next hour (with a frequency of 'hour') for 7 variables, I utilized the last 5 values of each variable to predict their collective state for the next hour.

from gluonts.

ArianKhorasani avatar ArianKhorasani commented on June 8, 2024

Dear @lostella - I'm trying the DeepVAREstimator for handling multivariate time series forecasting as below (I'd appreciate your suggestion! my context_length = 5 and prediction_length = 1. I did try to handle this error by filtering out the time series that are shorter than context_length but nothing changed!) :

```
estimator = DeepVAREstimator(
    prediction_length=prediction_length,
    context_length=context_length,
    freq="1H",
    num_layers = 2,
    distr_output=MultivariateGaussianOutput(dim=target.shape[1]),
    scaling=False,
    rank=7,
    batch_size=32,
    target_dim=7,
    trainer=Trainer(epochs = 30, ctx="cpu", learning_rate=1e-3, num_batches_per_epoch=100)
)
predictor = estimator.train(
    training_data=train_ds,
    shuffle_buffer_length=1024,
    cache_data=False,
)
```

but getting the same following error:

```
Exception: Reached maximum number of idle transformation calls.
This means the transformation looped over 619 inputs without returning any output.
This occurred in the following transformation:
gluonts.transform.split.InstanceSplitter(dummy_value=0.0, forecast_start_field='forecast_start', future_length=1, instance_sampler=ExpectedNumInstanceSampler(axis=-1, min_past=173, min_future=1, num_instances=1.0, total_length=0, n=0), is_pad_field='is_pad', lead_time=0, output_NTC=True, past_length=173, start_field='start', target_field='target', time_series_fields=['time_feat', 'observed_values'])

from gluonts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.