I am new to time series analysis, and I am wondering how I can approach forecasting having time series of different lengths. Specifically, each time series contains a sequence of ages and value. E.g.,

age_t value_t age_t-1 value_t-1

such as

12 210 11 205 10 203 9 203 ... 2 340 1 350
3 340 2 335 1 392

I want to forecast value_t+1. My problem is that I have time series of different lengths: for certain machines I have 15 years of history, for other machines I have 1-2 years of history.

Could anyone suggest a general way of approaching forecasting in this case, e.g., how to pre-process/transform the time series, or a method that is typically indicated in cases like this?

  • $\begingroup$ You could assume a sequence length. If the length of the time series is greater than that of the sequence length, cut it. If it's smaller than that left pad it with (0, 0). $\endgroup$ Aug 30, 2019 at 13:57

1 Answer 1


This should do the trick:

Independent variable (y): value_t

Dependent variables(features): age_t-1 value_t-1

Just add each row as examples jnto your ml model. If you predict value_t+1 or value_t is basically the same id the preprocessing is done correctly. Otherwise you could manually preprocess the features using pandas.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.