Closed ucsky closed 2 years ago
Hi Guillaume,
if I understood correctly, you want a way to split a long sequence in windows, reconstruct missing values inside each window, and then re-aggregate imputed windows together. If this is the case, then tsl.ops.imputation.prediction_dataframe
could fit. It takes as input a batch of windows paired with the corresponding time index and aggregates them in a single DataFrame according to the specified method. Among the methods, you can find 'mean' to take the average over windows or 'central' to take the imputation from the window in which the missing value was in a central position.
This method was used by us to generate imputations "in-sample" in the GRIN paper and has been just copied in tsl. We will improve it in the next versions of the library.
I hope I helped you.
Best,
Ivan
Hi Ivan,
Thanks, that is what I need. I just did a slight modification in order to handle multiple channels:
dfs = [
pd.DataFrame(
data=data.reshape(data.shape[0], data.shape[1]*data.shape[2]),
index=idx,
columns=columns)
for data, idx in zip(y, index)]
Cheers, Guillaume
Hello,
I try to reconstruct the final time series after imputation as it is done in figure 3 of https://arxiv.org/pdf/2108.00298.pdf.
Do you have an utility function or method in tsl package for this?
Cheers, Guillaume