QData / spacetimeformer

Multivariate Time Series Forecasting with efficient Transformers. Code for the paper "Long-Range Transformers for Dynamic Spatiotemporal Forecasting."
https://arxiv.org/abs/2109.12218
MIT License
806 stars 192 forks source link

Non-Time Independent Variable #55

Closed manuelarturosantana closed 2 years ago

manuelarturosantana commented 2 years ago

Hello and thanks for the great work! I am working on a forecasting battery data where given time and current I wish to predict voltage and temperature. So far I have tried putting current in y_context, but not y _target, which hasn't been working great. Rather than treat current as a y variable which needs to be predicted, I would like to use it in x_context, and x_target in predicting voltage and temperature. I tried just putting it into the x_context and x_target, but that didn't work which I suspect is because it thought the current was another time unit (like hours). Is there a better way to include current in x?

jakegrigsby commented 2 years ago

Hi, all x variables are time-based. It sounds like you want additional variables in y_context (which do not need to be predicted) that are not in y_target. Although it seems like you tried that so maybe I'm not quite sure what you mean. Extra variables like this are fully supported by the code but unfortunately there is not a good example to show you because they all used private datasets I had to remove before open-sourcing.

josh0tt commented 1 year ago

is there anything else that needs to be modified besides setting yc_dim, yt_dim, and specifying the appropriate target_cols in train.py for the case where there are additional variables in y_context that are not in y_target? I've been testing this out but I'm getting shape mismatch errors.