TorchSpatiotemporal / tsl

tsl: a PyTorch library for processing spatiotemporal data.
https://torch-spatiotemporal.readthedocs.io/
MIT License
267 stars 24 forks source link

Univariate Regression with SpatioTemporal Dynamics #47

Open ggmirandac opened 4 weeks ago

ggmirandac commented 4 weeks ago

Hi,

I was working on time series analysis, specially in systems where various parameters interact to an end. I was setting the model, but I only manage to do a n->n forecasting, this means that the model predicts all the channels passed to it. But, I think it would be nice to have a n->1 forecasting to specialize the model in one specific problem.

In this case, I think the main issue is in the way the SpatioTemporalDataset class is implemented, given that the target is the only thing modifiable and there is no input argument. Also, it would be cool to have the usage of the covariates and exogenous variables in a tutorial.

Thanks btw for the repo and software. I has been amazing learning how to use it.

marshka commented 2 weeks ago

Hi, thanks for your question!

You actually have more control over the dataset configuration beyond just setting the target in the SpatioTemporalDataset. While the documentation is still catching up in some areas, the flexibility is already there.

For your use case, you can initialize the dataset with your univariate signal as the target and add your graph-time signal as a covariate. If you name the covariate as x, everything should work seamlessly out of the box.

If you need more control over the naming conventions or further customization, you can take advantage of the BatchMaps feature in the SpatioTemporalDataset class. This allows you to map different inputs flexibly, giving you the ability to adapt the dataset variables to your requirements.

Feel free to reach out if you need further clarification!