MITB Banner

Guide To Implementing Time Series Analysis: Predicting Bitcoin Price With RNN

Share

In our previous articles, we have talked about Time Series Forecasting and Recurrent Neural Network. We explored what it is and how it is important in the class of Machine Learning algorithms. We even implemented a simple LSTM Network to evaluate its performance on the MNIST dataset. In this tutorial, we will take it a little further by forecasting a real-world data.

The cryptocurrency market has seen its rise and fall in the past few years. With a variety of coins being exchanged for real money, it is important to know the trend in the coin price. In this article, we will build a fairly simple LSTM network to predict or forecast the prices of Bitcoin.

Obtaining Bitcoin Data

There are plenty of open sources available on the internet to extract historical data of Bitcoin prices. The one that I have used below is from Coinmarketcap.

You can view and download the dataset here.

Loading And Understanding The Data

Importing Necessary Libraries

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

Importing The Dataset

complete_data = pd.read_excel('BitCoin_Prices.xlsx')
print(complete_data.head(20))

Output:

The dataset consists of 7 features. This is how most of the stock information datasets will look like. 

  1. Market Capitalisation/Market Cap: It is the total dollar market value of a company’s (in this case Bitcoin) outstanding shares.
  2. Volume: The total amount of security that changes hands over a given period of time (In this case the time period is one day)
  3. Close: The closing price of the stock(Bitcoin price at the end of the day).
  4. Low: Low denotes the lowest value or drop over the complete time period.
  5. High: The highest value or rise over the complete time period.
  6. Open: The opening price of the stock of a particular day.
  7. Date: The date of observation.

In this use case, we will predict the closing price of Bitcoin on a particular day, given the prices of Bitcoin over the past few days.

Let’s code!


PS: The story was written using a keyboard.
Share
Picture of Amal Nair

Amal Nair

A Computer Science Engineer turned Data Scientist who is passionate about AI and all related technologies. Contact: amal.nair@analyticsindiamag.com
Related Posts

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

Upcoming Large format Conference

May 30 and 31, 2024 | 📍 Bangalore, India

Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

AI Courses & Careers

Become a Certified Generative AI Engineer

AI Forum for India

Our Discord Community for AI Ecosystem, In collaboration with NVIDIA. 

Flagship Events

Rising 2024 | DE&I in Tech Summit

April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore

MachineCon GCC Summit 2024

June 28 2024 | 📍Bangalore, India

MachineCon USA 2024

26 July 2024 | 583 Park Avenue, New York

Cypher India 2024

September 25-27, 2024 | 📍Bangalore, India

Cypher USA 2024

Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA

Data Engineering Summit 2024

May 30 and 31, 2024 | 📍 Bangalore, India