How can I use variable length inputs to train a regression model? I'm working predicting a value $y \in \mathbb{R}$ from the value of $x_{n+1}$, where $n$ is the number of samples ($x_{i \in [1,n]}$) used for training.

Each training sample $x_{i}$ is a time series of variable lengths. How can I engineer features to predict $y$ while making the most of the samples available?

Nota bene:


I'm working with Python &amp; Scikit-learn
the length of the time series may be considered as an explanatory variable


Thanks for your help :)
A quick approach can be using a library like tsfresh, which extracts features from your time series, e.g. max value, number of peaks, median value, etc.

Normally, a thoughtful solution to this kind of problem involves domain knowledge, that is, insights from an expert that can tell you which aspects of your time series are important, e.g. frequent variations, very high peaks, plateaus, local patterns, etc. This knowledge is then used to derive ad hoc feature extractors.