(Day 24) Using neural nets for time series predictions

Ivan Ivanov · January 25, 2024

Hello :) Today is Day 24!

A quick summary of today:

  • Using neural nets to predict ₩/$ exchange rate on Kaggle

The data I used today was also used when I made the model I made on Day 7. But then I made a regression model, and today I made a neural network model.

image

First of all, to predict time series, I learned that it would be good to divide the data into windows

image image

Tuning the parameters above greatly affects the performance. It was fun to tune this parameter and model layer parameter a lot throughout the day and see how the performance was different

The final model is:

image image

Results:

image

Test data results:

image

Below, are various models, and modifications where I wanted to see the impact of hyperparameters, so I tuned the models manually.

  • model 1

image image

MAE: 0.02755

  • model 2 window_size = 183

image

MAE: 0.03141

  • model 3 window_size = 60

image MAE: 0.02798

  • model 4 shuffle_buffer_size = 5000

image MAE: 0.02503

  • model 5 shuffle_buffer_size = 10000

image MAE: 0.01939

  • model 6 window_size=45

image MAE: 0.03332

  • model 7 window_size=60; batch_size=16

image MAE: 0.02999

  • model 8 batch_size=32; added another LSTM layer

image image MAE: 0.01627

  • model 9 shuffle_buffer_size = 1000 (as it was originally)

image MAE: 0.02009

  • model 10 added another LSTM layer

image image MAE: 0.01756

  • model 11 shuffle_buffer_size = 5000

image MAE: 0.04496

  • model 12 shuffle_buffer_size=1000 + change of model architecture

image image MAE: 0.02415

  • model 13 changed model architecture again

image image MAE: 0.02625

There were other models too, but I did not take picture


That is all for today!

See you tomorrow :)

Original post in Korean