-- A deep learning approach for estimation of price determinants --
This repository uses recurrent neural networks/lstm to predict the price of 55 market currencies using keras library.
to use this repository, install required packages
- python==3.9.12
- keras==2.11.0
- sklearn==1.0.2
- numpy==1.21.5
- pandas==1.4.2
- matplotlib==2.2.3
using the following command:
pip3 install -r requirements.txt
from keras.layers import GRU, LSTM, CuDNNLSTM
from price_prediction import PricePrediction
ticker = "USD"
# init class, choose as much parameters as you want, check its docstring
p = PricePrediction("USD", epochs=1000, cell=LSTM, n_layers=3, units=256, loss="mae", optimizer="adam")
# train the model if not trained yet
p.train(data_path)
# predict the next price for profit
p.predict()
# print some metrics
print("Mean Absolute Error:", p.get_MAE())
print("Mean Squared Error:", p.get_MSE())
print(f"Accuracy: {p.get_accuracy()*100:.3f}%")
# plot actual prices vs predicted prices
p.plot_test_set()Mean Absolute Error: 145.36850360261292
Mean Squared Error: 40611.868264624296
Accuracy: 63.655%
git clone https://github.com/Abel-Blue/pricing-model.git
cd pricing-model
sudo python3 setup.py install
cd scripts
python test.py- Fine tune model parameters (
n_layers, RNNcell, number ofunits, etc.) - Tune training parameters (
batch_size,optimizer, etc. )