traja-team / traja

Python tools for spatial trajectory and time-series data analysis
https://traja.readthedocs.io
MIT License
101 stars 25 forks source link

Stock price forecasting demo #79

Open JustinShenk opened 3 years ago

JustinShenk commented 3 years ago

Demonstrate Traja with a stock market price forecasting example.

Good place to start is the Colab notebook: https://colab.research.google.com/github/justinshenk/traja/blob/master/demo.ipynb

JustinShenk commented 3 years ago

The model tests provide a good starting point for how to use the API.

Justus-M commented 3 years ago

@justinshenk is Traja currently limited to predicting all the input variables, or is there a way to pass specific endpoints or select a subset of inputs for prediction?

Ex. for this stock market price forecasting use case you would want to use (at least) volume, open, close and price as inputs, and then predict only the price.

Saran-nns commented 3 years ago

Yes,currently Traja doesn't support user specified variable prediction. dataset.MultiModalDataLoader, consider all features except 'ID' as time series and forecast/predict all time series variables 'k' steps forward.

Yes, by f:R^n-->R^m where m<<n, we can exploit traja models and ripe better predictive performance.

A simple work around is to 1) Add arg in MultiModalDataLoader to accept list of target_vars with assert output_dim==len(target_vars) in generate_dataset method 2) Override the targets here

Thanks for the issue.

JustinShenk commented 3 years ago

@Justus-M does this look like something you could help with?

Justus-M commented 2 years ago

Hi guys, sorry I never followed up on this. I did immediately spend some time looking at the documentation to try and implement this. I couldn't get it to run, and as my Pytorch experience is limited (I'm used to TensorFlow) it just ended up being much more time-consuming than initially expected, so I decided not to continue as it wasn't a priority and I have a lot on my plate at the moment.

I've uploaded some high resolution (minute level) long term apple stock price data, in case someone from the Traja team would like to test it themselves: https://drive.google.com/file/d/15Lhx9Txmxz7xvM0rFJ4HvMBwkUvdwyhB/view?usp=sharing

JustinShenk commented 2 years ago

Thanks in any case, Justus, for the update and sharing the data!

On Fri, Jan 28, 2022 at 2:36 PM Justus @.***> wrote:

Hi guys, sorry I never followed up on this. I did immediately spend some time looking at the documentation to try and implement this. I couldn't get it to run, and as my Pytorch experience is limited (I'm used to TensorFlow) it just ended up being much more time-consuming than initially expected, so I decided not to continue as I've got a lot on my plate at the moment.

I've uploaded some high resolution (minute level) long term apple stock price data, in case someone from the Traja team would like to test it themselves:

https://drive.google.com/file/d/15Lhx9Txmxz7xvM0rFJ4HvMBwkUvdwyhB/view?usp=sharing

— Reply to this email directly, view it on GitHub https://github.com/traja-team/traja/issues/79#issuecomment-1024232269, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOLMZAOKCHOD7GK4WZQVXDUYKLVJANCNFSM42HFZYDA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>