This notebook demonstrates the prediction of the bitcoin price by the neural network model. We are using long short term memory (LSTM)
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes
you need to install all the necessary libraries n order to run the project
sklearn
tensorflow
pandas
matplotlib
pip install sklearn
pip install tensorflow
pip install pandas
pip install matplotlib
- Getting real-time crptocurrency data(bitcoin).
- Prepare data for training and testing.
- Predict the price of crptocurrency using LSTM neural network (deep learning).
- Visualize the prediction results.
You can collect the current data for Bitcoin from Yahoo Finance

You can preprocess the data before dividing it into traning and testing
data_training = data[data['Date']< '2020-01-01'].copy()
data_training
data_test = data[data['Date']> '2020-01-01'].copy()
data_test
regressor = Sequential()
regressor.add(LSTM(units = 60, activation = 'relu', return_sequences = True, input_shape = (X_train.shape[1], 5)))
regressor.add(Dropout(0.2))
regressor.compile(optimizer = 'adam', loss='mean_absolute_error')
regressor.fit(X_train, Y_train, epochs = 20, batch_size =50)
Y_pred = regressor.predict(X_test)
Y_pred, Y_test
plt.figure(figsize=(14,5))
plt.plot(Y_test, color = 'red', label = 'Real Bitcoin Price')
plt.plot(Y_pred, color = 'green', label = 'Predicted Bitcoin Price')
plt.title('Bitcoin Price Prediction using RNN-LSTM')
plt.xlabel('Time')
plt.ylabel('Price')
plt.legend()
plt.show()


