This repository is dedicated to the bitcoin prediction. The phase of the prediction is the data extraction which for this project I used the the API that provided by https://www.cryptocompare.com/. Below I have added the top 5 responses which taken from the API:
After taking the required information from the API which varies from 2014 to 2020, I took this dataset and devided into 80% as the training test and 20% as the validation/test(10% validation and 10% test).At below figure you could see the behaviour of the timeseries that we are working on:
For training the LSTM, the data was split into windows of 7 days (this number is arbitrary, I simply chose a week here) and within each window I normalised the data to zero base, i.e. the first entry of each window is 0 and all other values represent the change with respect to the first value. Hence, I am predicting price changes, rather than absolute price.I used a simple neural network with a single LSTM layer consisting of 20 neurons, a dropout factor of 0.25, and a Dense layer with a single linear activation function. In addition, I used Mean Absolute Error (MAE) as loss function and the Adam optimiser. The LSTM model is as below:
once the model creation and prediction done we could see that the actual value and the predicted one are quite similar to each other: