Stock Price and Direction Prediction via Deep Attention-Based Convolutional Neural Networks
This is the repository for the "Stock Price and Direction Prediction via Deep Attention-Based Convolutional Neural Networks" CS 401 and CS 402 Senior Project at Ozyegin University. This is where you'll find all of the essential materials, such as code, data, and articles.
In order to run convmixer.py
, vision_transformer.py
, and mlp_mixer.py
one must have the exact versions of dependencies below.
Note that the code is incompatible with versions of tensorflow 2.5.0, 2.7.0, and 2.8.0.
- Keras: 2.6.0
- Tensorflow: 2.6.0
- Tensorflow Addons: 0.16.1
1. Clone the Repository to Your Local Machine
git clone https://github.com/kuantuna/SPDPvCNN.git
2.0 Make sure that your folder structure in the ETF folder looks exactly like the figure below. (By creating the necessary folders)
2.1 Run the data_creation.py
after setting the threshold value (default = 0.01) to create images and labels for the specified range of dates.
3. Later, in the architectures/helpers/constants.py
choose the architecture (selected_model) you want to use (by commenting others) and run the training.py
to train the model using the images created on the previous phase.
4. Finally, run the financial_evaluation.py
and computational_evaluation.py
to evaluate our model on the test data both financially and computationally.