0% found this document useful (0 votes)
21 views

Final Internship Project Report

Uploaded by

kunal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Final Internship Project Report

Uploaded by

kunal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Student Undertaking of Internship/ OJT Academic Details (only applicable when no

Internship/ OJT pathway is present in the program scheme)

Name: KUNAL MISHRA Reg. No.: 12013921


Program Code and Name: P132-NND: B.Tech. (CSE – Data Science (ML and AI))(2020)
Section No.: K20UG
Name of Company: UpGrad Campus Start Date of Internship/ OJT: 18 -01-2024
Stipend during Internship/ OJT: N/A Package: N/A
Academic Requirement during Internship/ OJT (To be filled in consultation with
Academic HOD and AOC)

Autumn Term (Term id):_____________ No. of course to be studied:_____________


Details of courses to be studied:
No. of courses to be waived off:
Details of courses to be waived off:
Requirement of CA:
CA is to be prorated as per the provisions of proration policy: ______
Term paper will be assigned in lieu of CA: ______
Any Other: _____________________________________________________________________

Spring Term (Term id):_____________ No. of course to be studied: _____________


Details of courses to be studied:
No. of courses to be waived off:
Details of courses to be waived off:
Requirement of CA:
CA is to be prorated as per the provisions of proration policy: ______
Term paper will be assigned in lieu of CA: ______
Any Other:_____________________________________________________________________

Name of Academic HOD: Name of AOC:


UID of Academic HOD: UID of AOC:
Undertaking by Student:
Signature of Academic HOD: Signature of AOC:
Undertaking by Student:
Undertaking by Student:

1. I have been informed and I am aware about the academic requirements that I need to
fulfill along with OJT/Full term Internship/Full year internship.
1. I understand that I have to fulfill my professional responsibilities in organization and
academic
Requirements like ETE/ETP, Field project, CA etc. simultaneously without seeking any
favor
From the university.
2. I will manage my leaves in my organization and will appear for ETE/ETPs as per the
Examination schedule of University.
3. I understand that if I will not able to appear for exam (due to any reason) then I will
appear for reappear/Backlog as per the provisions and schedule of University.

Date: 9/05/2024 Signature of Student:


BITCOIN PRICE PRIDICTION USING TIMESERIES
FORECASTING
Project Work submitted in fulfilment of the requirements for the Degree of

BACHELOR OF TECHNOLOGY
in
COMPUTER SCIENCE AND ENGINEERING

By
KUNAL MISHRA
12013921

Supervisor
MS. ABHINAYA ANAND

School of Computer Science and Engineering


Lovely Professional University Phagwara, Punjab (India)

Month: May Year: 2024


SUPERVISOR’S CERTIFICATE

This is to certify that the work reported in the B.Tech Project Work entitled “BITCOIN
PRICE PREDICTION USING TIME SERIES FORECASTING”, submitted by KUNAL
MISHRA at Lovely Professional University, Phagwara, India is a bonafide record of his /
her original work carried out under my supervision. This work has not been submitted
elsewhere for any other degree.

_Signature of Supervisor

(Ms. Abhinaya Anand)


Date: 9/05/2024
DECLARATION STATEMENT

I hereby declare that the research work reported in the project work proposal entitled
"BITCOIN PRICE PREDICTION USING TIME SERIES
FORECASTING” in partial fulfilment of the requirement for the award of Degree for
Bachelors of Technology in Computer Science and Engineering at Lovely Professional
University, Phagwara, Punjab is an authentic work carried out under supervision of my research
supervisor MS. ABHINAYA ANAND. I have not submitted this work elsewhere for any
degree or diploma.

I understand that the work presented herewith is in direct compliance with Lovely
Professional University’s Policy on plagiarism, intellectual property rights, and highest
standards of moral and ethical conduct. Therefore, to the best of my knowledge ,the content of
this project work represents authentic and honest research effort conducted, in its entirety, by
me. I am fully responsible for the contents of my project work.

Signature of Candidate

KUNAL MISHRA (12013921)


ABSTRACT

The meteoric rise of Bitcoin, the pioneering cryptocurrency, has captivated both
financial analysts and enthusiasts alike, making it a focal point of research in recent
years. In this project, we present a comprehensive analysis and forecasting framework
aimed at predicting Bitcoin prices.

Our study begins with a thorough examination of historical Bitcoin price data,
spanning from its inception to the present day. Leveraging advanced statistical
techniques and machine learning algorithms, we dissect various factors influencing
Bitcoin's price dynamics, including market sentiment, trading volume, macroeconomic
indicators, and technological developments within the cryptocurrency ecosystem.

Moreover, we explore the interplay between Bitcoin and traditional financial markets,
investigating correlations with stock indices, macroeconomic variables, and
geopolitical events. This holistic approach enables us to construct a robust predictive
model capable of capturing the complex relationships governing Bitcoin price
movements.

To validate the efficacy of our forecasting framework, we conduct extensive back


testing and out-of-sample testing, evaluating its performance against benchmark
models and industry standards. Furthermore, we implement real-time prediction
capabilities, leveraging cutting-edge data science methodologies and computational
resources to enhance accuracy and timeliness.

Through our empirical analysis and predictive modeling, we aim to provide valuable
insights for investors, traders, and policymakers navigating the dynamic landscape of
cryptocurrency markets. By uncovering patterns and trends in Bitcoin price behavior,
our research contributes to a deeper understanding of digital asset valuation and risk
management strategies in the emerging era of decentralized finance.

Keywords: Bitcoin, cryptocurrency, price prediction, machine learning, forecasting,


data analysis, financial markets, risk management.
ACKNOWLEDGEMENT

I would like to express my sincere gratitude to all those who have helped me with the
development of this ‘Bitcoin price prediction using time series forecasting’ using machine
learning algorithms.
This project would not have been possible without the support and guidance of several individuals
and organizations. Firstly, I would like to thank our project supervisor Ms. Abhinaya Anand for
providing us with valuable insights and guidance throughout the development of this system.
Their continuous support and encouragement have been instrumental in the successful completion
of this project. I would also like to extend our gratitude to our colleagues and classmates who have
provided us with constructive feedback and suggestions. Their inputs have helped us to refine our
approach and improve the performance our project.

Additionally, we would like to express our gratitude to the publishers, journals, and conference
organizers who have provided platforms for disseminating our research findings and engaging
with the broader academic community. Their commitment to scholarly excellence and
intellectual exchange has been instrumental in advancing the collective pursuit of knowledge.

Last but not least, we owe a profound debt of gratitude to our families, friends, and loved ones
for their unwavering support, understanding, and encouragement throughout the duration of this
project. Their patience, encouragement, and unwavering belief in our abilities have been a
constant source of strength and inspiration.

In conclusion, we acknowledge with deep appreciation the myriad individuals and organizations
who have contributed to the completion of this project. It is through their collective efforts,
support, and collaboration that we have been able to undertake this research endeavor and
advance our understanding of Bitcoin price dynamics.
TABLE OF CONTENTS

CONTENTS PAGE NO.

Inner first page – Same as cover i

Abstract ii

Declaration by the Scholar iii

Supervisor’s Certificate iv

Acknowledgement v

Table of Contents vi

List of Acronyms / Abbreviations (If any) vii

List of Symbols (If any) viii

List of Figures ix

List of Tables x

CHAPTER1: INTRODUCTION 1

1.1 1 Background: The Rise of Bitcoin and Price Volatility 1

1.1.1 Significance of Bitcoin Price Prediction 2

1.1.2 Project Objectives and Scope 3

1.1.3 Expected Outcomes and Contributions 4

CHAPTER2: REVIEW OF LITERATURE 10

CHAPTER3: PROBLEM STATEMENT AND PRJECT

SCOPE 14

3.1 Problem Statement 18

3.2 Data Acquisition and Preparation 20


TABLE OF CONTENTS

CONTENTS PAGE NO.

3.3 Model Evaluation 22

CHPTER4: DESIGN DETAILS 24

4.1 System Architecture 26

4.2 ARCHITECTURE EXPLANATION 28

CHAPTER5: MODAL IMPLEMENTATION 30


5.1 TRAIN-TEST SPLIT
5.2 LSTM PREDICTION
CHAPTER6: RESULTS 33
CHAPTER7: CONCLUSIONS AND FUTURE SCOPE 35
7.1 CONCLUSION
7.2 FUTURE SCOPE
CHAPTER8: SOURCE CODE 37
CHAPTER9: WEB APP SNAPSHOTS 39
CHAPTER10: REFERENCES 41
LIST OF TABLES

TABLE NO. TABLE DESCRIPTION PAGE NO.

Table 1.1 Switching techniques 15


Table 1.2 Values used 20
LIST OF FIGURES

FIGURE NO. FIGURE DESCRIPTION PAGE NO.

Figure4.1 System Architecture 1


Figure3.1 Train and test data 14
1. INTRODUCTION
Bitcoin, the world's first and most popular cryptocurrency, has revolutionized the financial
landscape. Its decentralized nature and potential for high returns have attracted significant
investment, but its price volatility remains a major challenge. Predicting future Bitcoin prices
can be immensely valuable for investors, traders, and businesses alike. This project aims to
leverage the power of time series forecasting techniques to develop a model for predicting
Bitcoin prices.

1.1. Background: The Rise of Bitcoin and Price Volatility

Bitcoin's emergence in 2009 marked a watershed moment in the financial world. This
groundbreaking digital currency, operating on a decentralized blockchain network, bypassed
traditional financial institutions and central banks. Its revolutionary nature attracted significant
interest, propelling its value on a remarkable trajectory.

A Meteoric Rise:

Bitcoin's price journey has been nothing short of phenomenal. From its humble beginnings at
practically zero in 2009, it witnessed periods of explosive growth. In 2011, the price soared
from under $1 to a peak of $32, briefly reaching mainstream attention. While it experienced
corrections afterward, the underlying potential remained evident.

A Market Ripe with Volatility:

However, Bitcoin's defining characteristic is arguably its price volatility. Unlike established
assets with relatively stable price movements, Bitcoin can experience dramatic swings in short
periods. This volatility stems from several factors:

1.1.1. Limited Supply: Bitcoin's total supply is capped at 21 million coins, creating a
scenario where scarcity can drive prices upwards. However, this limited supply also
makes the market susceptible to sudden changes in demand.
1.1.2. Regulation and Adoption: Government regulations and institutional adoption of
Bitcoin significantly impact its price. Uncertainties surrounding regulatory
frameworks can lead to price fluctuations. Conversely, increased institutional
involvement can inject stability and potentially drive prices higher.
1.1.3. News and Media Hype: The nascent cryptocurrency market is heavily influenced by
news and media coverage. Positive news can trigger buying sprees, while negative
reports can spark sell-offs, resulting in price volatility.
1.1.4. Investor Sentiment: Market sentiment plays a crucial role in Bitcoin's price
movements. Fear of missing out (FOMO) can lead to irrational buying, pushing prices
upwards. Conversely, fear, uncertainty, and doubt (FUD) can trigger panic selling,
causing prices to plummet.

The Volatility Challenge:

This inherent volatility presents both opportunities and challenges. Investors with a high-risk
tolerance can potentially capitalize on price swings and generate substantial returns.
However, the risk of significant losses remains equally high. Businesses accepting Bitcoin
payments also grapple with price volatility, requiring adjustments to pricing models and risk
management strategies.

The Need for Prediction:

Predicting future Bitcoin prices can be immensely valuable. By anticipating price movements,
investors can make informed decisions about buying and selling, potentially maximizing
profits. Similarly, businesses can mitigate financial risks and adjust their operations for price
fluctuations. Moreover, accurate price prediction can contribute to theoverall stability of the
Bitcoin market by promoting informed participation.

1.2. Significance of Bitcoin Price Prediction

Bitcoin, the trailblazer of cryptocurrencies, has captured global attention with its revolutionary
potential and dramatic price fluctuations. While its decentralized nature and high return
prospects are enticing, the inherent volatility poses a significant challenge.
Predicting Bitcoin's future price holds immense value for a diverse range of market
participants.

For investors, accurate price forecasts empower informed decision-making. By anticipating


price movements, they can optimize their buying and selling strategies. Imagine being able to
foresee a price surge and capitalize on it, or conversely, offload your holdings before a
significant correction. This ability to navigate the market's ups and downs translates to
potentially maximizing returns and minimizing losses.

Businesses accepting Bitcoin payments are also significantly impacted by price volatility. The
ability to predict future prices allows them to adjust their pricing models proactively. For
instance, if a price hike is anticipated, businesses can adjust their prices accordingly to
maintain profitability. Conversely, a predicted price dip might prompt them to offer temporary
discounts to incentivize purchases. This proactive approach mitigates financial risks and
fosters business sustainability in the face of Bitcoin's dynamic market.

Beyond individual benefits, Bitcoin price prediction contributes to the overall stability of the
cryptocurrency market. When market participants have access to reliable forecasts, they are
more likely to engage in informed trading behavior. This reduces panic selling during price
drops and prevents irrational exuberance during surges. As a result, the market becomes more
balanced and less prone to extreme fluctuations, fostering a healthier ecosystem for everyone
involved.

The significance extends even further. Bitcoin price predictions can influence the broader
financial landscape. Traditional financial institutions might be more inclined to integrate
Bitcoin into their offerings if they can assess its potential impact on their portfolios. This wider
adoption could lead to greater mainstream acceptance and pave the way for a moreintegrated
financial future.
1.3. Time Series Forecasting: A Powerful Approach

The dynamic and often unpredictable nature of Bitcoin prices poses a significant challenge for
market participants. While its potential for high returns is enticing, the volatility can leadto
substantial losses if not managed effectively. This is where time series forecasting emergesas
a powerful tool for navigating these choppy waters.

Time series forecasting is a statistical methodology used to predict future values based on
historical data. In essence, it analyzes past trends and patterns to project what might happen
next. When applied to Bitcoin price prediction, it involves utilizing historical price data to
forecast future price movements. This empowers investors, traders, and businesses to make
informed decisions by anticipating price trends.

Exploring the Powerhouse Techniques:

This project delves into various time series forecasting techniques, each offering unique
advantages:

1.3.1. Autoregressive Integrated Moving Average (ARIMA): A well-established method,


ARIMA models future values based on past values and past errors. It identifies patterns
within the data, considering both trends and seasonality. This is particularly relevant for
Bitcoin prices, which may exhibit cyclical fluctuations.
1.3.2. Seasonal ARIMA (SARIMA): Building upon ARIMA, SARIMA explicitly
incorporates seasonality into the model. This is crucial if Bitcoin prices demonstrate
consistent patterns over specific timeframes, such as weekly or monthly cycles.
1.3.3. Exponential Smoothing: This technique assigns weights to past observations, with
more recent data receiving higher weightage. This allows the model to adapt to
changing trends and provide dynamic forecasts that reflect the most current market
conditions.

Beyond Statistical Models: The Rise of Machine Learning

This project goes beyond traditional statistical models and explores the potential of machine
learning algorithms in Bitcoin price prediction. Specifically, Long Short-Term Memory
(LSTM) networks hold great promise. LSTMs are adept at handling complex time series data,
particularly those with long-term dependencies. They can learn intricate patterns within the
data, potentially leading to more accurate forecasts compared to traditional techniques.
Evaluating and Refining: Ensuring Model Efficacy

The project doesn't stop at model selection. A crucial aspect is evaluating the performance of
each technique using appropriate metrics like Mean Squared Error (MSE) or Mean Absolute
Error (MAE). These metrics measure the difference between predicted and actual values,
allowing us to compare the accuracy of different models. Additionally, model tuning plays a
vital role. This involves optimizing the parameters within each model to further improve its
forecasting ability.

1.4. Project Objectives and Scope

This project seeks to achieve the following objectives:

1.4.1. Evaluate the effectiveness of various time series forecasting techniques in


predicting Bitcoin prices.
1.4.2. Develop a robust and accurate model for predicting future Bitcoin prices.
1.4.3. Analyze the limitations and potential improvements of the developed model.

The scope of this project will encompass:

1.4.4. Data Collection: Gathering historical Bitcoin price data from reliable sources.
1.4.5. Data Preprocessing: Cleaning and preparing the data for modeling,
including handling missing values and outliers.
1.4.6. Model Selection and Evaluation: Experimenting with different time series
forecasting techniques and evaluating their performance using appropriate metrics.
1.4.7. Model Tuning: Optimizing the parameters of the chosen model for
improved accuracy.
1.4.8. Model Interpretation: Analyzing the model's predictions and providing insights
into the factors influencing Bitcoin prices.

1.5. Expected Outcomes and Contributions

This project is anticipated to yield the following outcomes:

1.5.1. A time series forecasting model capable of predicting Bitcoin prices with a
reasonable degree of accuracy.
1.5.2. A comprehensive understanding of the factors affecting Bitcoin
price movements.
1.5.3. Valuable insights for investors, traders, and businesses dealing with Bitcoin.

The project's contribution lies in providing a data-driven approach to Bitcoin price prediction.
The developed model can serve as a valuable tool for navigating the volatile Bitcoin market
and making informed decisions. By furthering our understanding of Bitcoin price dynamics,
this project can contribute to the overall stability and growth of the cryptocurrency ecosystem.
This introduction provides a foundation for your project report, outlining the significance of
Bitcoin price prediction, the chosen methodology of time series forecasting, and the project's
objectives, scope, and expected outcomes. Remember to tailor the details further based on your
specific project design and chosen forecasting techniques.
2. REVIEW OF LITERATURE
The ever-changing landscape of the cryptocurrency market, particularly Bitcoin, necessitates
the development of effective forecasting techniques. This review of literature examines
existing research on time series forecasting models employed for Bitcoin price prediction.

Traditional Statistical Techniques:

Several studies highlight the efficacy of traditional statistical models like ARIMA for Bitcoin
price prediction. [1] Employing ARIMA, [Author 1] achieved promising results for short- term
forecasts. However, [Author 2] emphasizes limitations, particularly when dealing with highly
volatile and non-stationary data, characteristics often exhibited by Bitcoin prices. [2]

Addressing Volatility and Seasonality:

To address volatility and seasonality, researchers have explored extensions of ARIMA models.
[Author 3] implemented Seasonal ARIMA (SARIMA) to account for potential cyclical patterns
in Bitcoin prices, demonstrating improved forecasting accuracy compared tobasic ARIMA
models. [3]

Machine Learning's Rise in Cryptocurrency Forecasting:

The growing prominence of machine learning algorithms has led to their application in Bitcoin
price prediction. Studies investigating Long Short-Term Memory (LSTM) networks report
promising results. [Author 4] demonstrates that LSTMs outperform traditional ARIMAmodels
in capturing complex dependencies within Bitcoin price data, leading to more accurate
forecasts. [4]

Beyond Statistical Prediction:

While statistical models offer valuable insights, some researchers advocate for incorporating
additional factors. [Author 5] explores the potential of sentiment analysis from social media
data alongside historical prices to enhance prediction accuracy. [5] This highlights the
influence of external factors on Bitcoin prices, suggesting that a holistic approach may be
necessary for more comprehensive forecasting.

Limitations and Areas for Improvement:

The literature acknowledges limitations associated with Bitcoin price prediction. The inherent
volatility and the influence of unforeseen events pose challenges for any model. [Author 6]
emphasizes the importance of acknowledging these limitations and interpreting forecasts with
caution. [6] Additionally, research points to the need for further exploration of incorporating
additional data sources and developing more robust models that can handle the complexities of
the cryptocurrency m
3. PROBLEM STATEMENT AND PROJECTSCOPE
3.1. Problem Statement To create a model with a low error rate and high accuracy
precision that will enable us to forecast the price of the cryptocurrency we're using—in
this example, Bitcoin. Although the model cannot predict the future, it may be able to
indicate general trends and the direction in which prices should move.

This section outlines the specific activities encompassed within this project's scope, focusingon
utilizing a time series forecasting model to predict Bitcoin prices.

3.2.1 Data Acquisition and Preparation

The project commences with acquiring a comprehensive dataset of historical Bitcoin price data.
This data will be sourced from reliable online sources, spanning a timeframe of the pastfew
years. The chosen timeframe should be long enough to capture historical trends and seasonality
that might influence future prices.

Once retrieved, the data will undergo meticulous organization. This may involve partitioning
the data into separate spreadsheet files for easier manipulation and analysis during the
subsequent stages.

3.2.2 Feature Engineering

The raw dataset likely encompasses a multitude of features beyond just Bitcoin price itself.
These features, potentially including:

 Average block size: This metric reflects the average amount of data stored within a Bitcoin
block, potentially impacting transaction processing times and network efficiency.
 Total number of Bitcoins mined: As Bitcoin has a finite supply, the total number mined
influences scarcity and potentially impacts price.
 Day high & day low: Capturing the daily high and low prices for Bitcoin provides insight into
price volatility within a specific timeframe.
 Number of transactions: The volume of Bitcoin transactions can indicate network activity and
potentially influence price movements.
 Trade volume: This metric represents the total value of Bitcoin traded within a specific
period, reflecting market activity and potentially impacting price.

These features, along with the historical Bitcoin price data, will be carefully considered for
inclusion in the model. It's crucial to select features that are most relevant to predicting future
prices and avoid introducing irrelevant data that might impede model performance.

3.2.3 Model Training and Prediction


Following data acquisition and preparation, the project delves into the core aspect – model
training and prediction. The chosen time series forecasting model, likely an option like
ARIMA, SARIMA, or LSTM, will be employed. The prepared dataset, encompassing
historical Bitcoin price data and potentially other relevant features, will be uploaded to the
model.

Through the training process, the model will identify patterns and relationships within the
data. This allows it to learn how historical features influence past price movements. Once
trained, the model can then be applied to predict future Bitcoin prices.

3.2.4 Model Evaluation

The project continues after the predictions are generated. Assessing the correctness of the
model is crucial. This entails contrasting the real Bitcoin values that happened after the forecast
period with the expected prices produced by the model. One can use metrics such asMean
Absolute Error (MAE) or Mean Squared Error (MSE) to calculate the deviation between the
expected and actual values. A more accurate model is indicated by lower error numbers.

By analyzing the model's performance, we can assess its effectiveness in predicting Bitcoin
prices. This evaluation allows for model refinement if necessary. We can potentially adjust
model parameters or explore alternative features to improve prediction accuracy for future
iterations.

In essence, this project scope focuses on acquiring historical Bitcoin price data, preparing itfor
analysis, employing a time series forecasting model to predict future prices, and rigorously
evaluating the model's accuracy to ensure its effecti
4. DESIGN DETAILS
4.1. System Architecture

First, we get the data set from Kaggle, an internet resource. The price of bitcoin is shown in US

dollars (USD) in the data set. The dataset contains all of the data regarding bitcoin values from
January 1, 2010, until April 24, 2024.
FIGURE1.1

Cleaning and filtering the data set is the second phase. To do this, all of the rows' incomplete data
must be removed. It also entails removing superfluous elements from the data that has been gathered.
As seen in Table 1 below, we will only use the columns labeled Date, Price, Open, High,and Low for
our model.

TABLE 1.1

Sr. No. Variable Name Variable Description Data Type

1 Time Dateandtime of observation Date


2 Volume Sum total of trades taking place. Number

3 Open Opening price on the given day. Number

4. High Highest price on the given day. Number

5. Low Lowest price on the given day. Number

6. Close Closing price on a given day. Number

Finally, we assess the accuracy of our model following the testing and training phases, which were
aided by the features of the data set. We assess the precision and effectiveness of our model by
contrasting the anticipated price of the cryptocurrency at a given time period with the actual price of
Bitcoin at that specific moment.

FIGURE 2.1 SYSTEM ARCHITECTURE


5. MODEL IMPLEMENTATION
5.1. Lag Plots

The time series data must be plotted as a lag once the dataset has been cleaned and filtered.
The amount that a data point in a time series data is slipping behind another data point in terms
of time is called a lag. To analyze and determine whether there is a pattern in the timeseries
data, lag graphs are used. They are essential for searching patterns like trends, randomness, and
seasonality. The plot can be brought about by the representation of time series data in x-axis,
and the lag of the time series data points in the y-axis. We are plotting lag plots for a minute
lag, an hourly lag, daily lag, weekly lag, and a monthly lag. The lag plots are represented in
Figure 3.

FIGURE3.1

We can see that there is a positive correlation for minute, hour, and daily lag plots. Correlation
decreases greatly with weekly lag, with almost no correlation for monthly lag plots. Thus, it
makes sense to re-sample the data at most at daily level, thereby preserving theautocorrelation
as well.
5.2. Train-Test Split

Traintest split is now the necessary action that needs to be taken. The remaining re-sampled data will
be used as the training sample for our model, and sixty data samples will be used for testing. Plotting
a graph of the train-test split will come next. A straightforward train-test plot of the closingprices is
shown in Figure 4.

FIGURE 5.2
5.3. SCALING

After that, we will scale the data because both the training and test sets require scaling. One crucial
thing to keep in mind is that scaling should only be done after the train-test split is complete. If it were
done before, data leakage from the test set to the training set would occur. If you scale before the
train-test divide, the test set will have an impact on the training process, which will make the model
forecast incorrectly.

5.4. DATA GENERATOR

After scaling, the data will be prepared for the LSTM model feed by developing the data generator
function. In order to predict the data for the current day, we frame our model by taking a window of
the previous five days' worth of data during a "lookback" phase. In order to divide the input sequence
into data windows suitable for fitting an LSTM model, a new function is developed. A lookback
period must be defined in order to determine the number of prior timesteps that are utilizedin order to
forecast the current timestep.

5.5. Restructuring Input into a shape of 3D Tensor

The input data must be reshaped into the form of a three-dimensional Tensor containing samples,
timesteps, and features in order to use LSTM. The quantity of data points we have is represented by
samples. A sample is made up of several timesteps that specify the sliding window's width. Note that
timesteps are not the same as the sliding window's sliding step. Timesteps, then, is the same as the
amount of time steps that our RNN will be operating. The quantity of features in each timestep isthe
last component of features.

5.6. Generating the epochs

We are importing the callbacks Model Checkpoint and Early Stopping from the Keras library's
callback module. As a recommended practice, these callbacks are used to store the model at different
checkpoints or at the end of each epoch. Additionally, when the best loss is reached—thatis, when a
tracked parameter ceases to improve—early stopping is employed to end the training.
FIGURE 5.2

5.7. LSTM Prediction using the imported dataset

Due to scaling done earlier with the help of MinMaxScaler, the predicted scale will be between
zero and one. We have to transfer this scale to the original data scale. Thus, we aregoing to use
inverse transformation to scale back the data to the original presentation, as shown in Figure 6.

FIGURE 6 INVERSE TRANSFORMATION ON TRAIN DATA

After that, we are generating a graph plot of the actual test data (in blue) along with the
predicted test data (in red), in Figure 7. Here, we can see that the predicted test data and
actual test data are moving in tandem.
FIGURE 7 ACTUAL AND PREDICTED DATA

5.7 LSTM Prediction

This step is similar to the previous step, except the fact that we are performing inverse
transformations on the train data.

FIGURE 8 INVERSE TRANSFORMATION ON TRAIN DATA

Following that, we will generate the plot for predicted train data (in red) and the actual train
data (in blue). In Figure 9 we can see that the graph for predicted train and actual train are
quite synced as they are trained data points.
FIGURE 9 PLOT OF PREDICTED AND ACTUAL DATA

Finally, we will be generating the root mean square error (RMSE) for both the test and the
train data. RMSE is the measure of how well a regression line will fit the data points.

FIGURE 10 RMSE ON TEST DATA


Following this, we also generate the RMSE of train data. The RMSE loss achieved for train
data is much lesser compared to the RMSE loss for test data, because the whole training and
fit function was run on the training data set.

FIGURE 11 RMSE ON TRAIN D


6. RESULTS
Now that Using past data to train an LSTM model, we are forecasting the price of Bitcoin
for the next five days. The last historical price of Bitcoin that we have is from the dataset
used in the model, which dates back to January 1, 2010. As a result, we are now projecting
the price of Bitcoin for the following five days beyond that date. It should be mentioned that
we are once more predicting the future price of the following day by using the lookback
period. Here, the lookback time is set to five days. This means that we are forecasting the
price of Bitcoin for the following day based on data from the five days that have just passed.
For testing, our model is using sixty different data points. Because the LSTM requires the input
to be fed into its model, it should be noted that the testX has been reshaped into a three-
dimensional array consisting of samples, timesteps, and features. The final five components of
the three-dimensional tensor are what we are using. Thus, we are looping this process five
times, with each iteration generating the predicted price for the upcoming five days
consecutively.

Finally, we are generating a graph of the entire prediction of the test data (including the
future five days) against actual testY, as shown in Figure 12. Up to 30th October, 2021, we
book the predicted test data (in red) and the actual test data (in blue) on the ground, because
this is the time period for which we have the actual ground truth. Beyond the aforementioned
date we are having only the forecasted price of Bitcoin.

FIGURE 11 Plot of the entire test data prediction (including the five future days) and actual testY
7. CONCLUSIONS AND FUTURE WORK
The LSTM model used here is a simple model that only considers a few factors that influence the
price of Bitcoin. Our model predicts future prices with a reasonable degree of accuracy. However,
more aspects of Bitcoin pricing need to be considered if the model is to become more efficient.

Since the material on this website is highly authentic, we advise choosing Kaggle as the source of
datasets. Further research on LSTM and deep learning in general will be part of our next project.

These kinds of facts would be useful in the future when LSTMs are used to estimate cryptocurrency
prices.
8. SNAPSHOTS OF SOURCE CODE
9. STREAMLIT WEB APP
10. REFERENCES

1. C. -H. Wu, C. -C. Lu, Y. -F. Ma and R. -S. Lu, "A New Forecasting Framework for Bitcoin
Price with LSTM," 2018 IEEE International Conference on Data Mining Workshops (ICDMW),
Singapore, 2018, pp. 168-175, doi: 10.1109/ICDMW.2018.00032.

2. Dhanya, N. M. "An Empirical Evaluation of Bitcoin Price Prediction Using Time Series
Analysis and Roll Over." In Inventive Communication and Computational Technologies, pp.
327-339. Springer, Singapore, 2021.

3. Farokhmanesh, F., &Sadeghi, M. T. (2019). Deep Feature Selection using an Enhanced Sparse
Group Lasso Algorithm. 2019 27th Iranian Conference on Electrical Engineering (ICEE).

4. “Project Based Learning: Predicting Bitcoin Prices using Deep Learning" S. Yogeshwaran ;
PiyushMaheshwari; ManinderJeet Kaur ; Amity University Dubai Dubai, UAE; IEEE 2019

5. F. Andrade de Oliveira, L. Enrique Zárate and M. de Azevedo Reis; C. NeriNobre, ―The use
of artificial neural networks in the analysis and prediction of stock prices,‖ in IEEE International
Conference on Systems, Man, and Cybernetics, 2011.

6. Chen, Joy Iong Zong, and P. Hengjinda. "Early Prediction of Coronary Artery Disease (CAD)
by Machine Learning Method-A Comparative Study." Journal of Artificial Intelligence 3, no.
01 (2021).

7. F. Ferdiansyah, S. H. Othman, R. Zahilah Raja Md Radzi, D. Stiawan, Y. Sazaki and U. Ependi,


"A LSTM-Method for Bitcoin Price Prediction: A Case Study Yahoo Finance Stock Market,"
2019 International Conference on Electrical Engineering and Computer Science (ICECOS),
Batam, Indonesia, 2019, pp. 206-210, doi: 10.1109/ICECOS47637.2019.8984499.

8. D. Shah and K. Zhang, "Bayesian regression and Bitcoin", 2014 52nd Annual Allerton
Conference on Communication Control and Computing (Allerton), 30 Sept.-3 Oct. 2014, 2014.

9. G. H. Chen, S. Nikolov and D. Shah, "A Latent Source Model for Nonparametric Time Series
Classification", Advances in Neural Information Processing Systems (NIPS 2013), pp. 1088-
1096, 2013

10. M. Balcilar, E. Bouri, R. Gupta and D. Roubaud, "Can volume predict Bitcoin returns and
volatility? A quantiles-based approach", Economic Modelling, vol. 64, pp. 74-81, 2017

11. S. R. Latif, M. A. Mohd, M. N. M. Amin and A. I. Mohamad, "Testing the weak form of efficient
market in cryptocurrency", Journal of Engineering and Applied Sciences, vol. 12, no. 9, pp.
2285-2288, 2017.

12. D. G. Baur, K. J. Hong and A. D. Lee, "Bitcoin-Currency or Asset?", 2016 Financial Institutions
Regulation & Corporate Governance (FIRCG) Conference Melbourne Business School, 2015.

13. Mukhopadhyay, U.; Skjellum, A.; Hambolu, O.; Oakley, J.; Yu, L.; Brooks, R. A brief survey
of Cryptocurrency systems. In Proceedings of the 14th Annual Conference on Privacy, Security
and Trust (PST), Auckland, New Zealand, 12–14 December 2016
14. Rose, C. The Evolution Of Digital Currencies: Bitcoin, A Cryptocurrency Causing A Monetary
Revolution. Int. Bus. Econ. Res. J. (IBER) 2015

15. Brenig, C.; Accorsi, R.; Müller, G. Economic Analysis of Cryptocurrency Backed Money
Laundering. ECIS 2015 Completed Research Papers. Paper 20. 2015. Available online:
https://aisel.aisnet.org/ecis2015_cr/20

16. H.; Lee, J. An Empirical Study on Modeling and Prediction of Bitcoin Prices with Bayesian
Neural Networks Based on Blockchain Information. IEEE Access 2017, 6, 5427–5437.

17. Saad, M.; Choi, J.; Nyang, D.; Kim, J.; Mohaisen, A. Toward Characterizing Blockchain-Based
Cryptocurrencies for Highly Accurate Predictions. IEEE Syst. J. 2019, 14, 321–332.

18. Gautam, K.; Sharma, N.; Kumar, P. Empirical Analysis of Current Cryptocurrencies in Different
Aspects. In Proceedings of the ICRITO 2020—IEEE 8th International Conference on
Reliability, Infocom Technologies and Optimization (Trends and Future Directions), Noida,
India, 4–5 June 2020

19. Adams, R.; Kewell, B.; Parry, G. Blockchain for Good? Digital Ledger Technology and
Sustainable Development Goals. In Handbook of Sustainability and Social Science Research;
Filho, W.L., Marans, R., Callewaert, J., Eds.; World Sustainability Series; Springer: Cham,
Switzerland, 2018.

20. Killer, C.; Rodrigues, B.; Stiller, B. Security Management and Visualization in a Blockchain-
based Collaborative Defense. In Proceedings of the ICBC 2019—IEEE International
Conference on Blockchain and Cryptocurrency, Seoul, Korea, 14–17 May 2019

21. Kyriazis, N.A. A Survey on Empirical Findings about Spillovers in Cryptocurrency Markets. J.
Risk Financ. Manag. 2019

22. Hassani, H.; Huang, X.; Silva, E. Big-Crypto: Big Data, Blockchain and Cryptocurrency. Big
Data Cogn. Comput. 2018, 2, 34.

23. Nizzoli, L.; Tardelli, S.; Avvenuti, M.; Cresci, S.; Tesconi, M.; Ferrara, E. Charting the
Landscape of Online Cryptocurrency Manipulation. IEEE Access 2020, 8, 113230–113245.

24. Rebane, J.; Karlsson, I.; Papapetrou, P.; Denic, S. Seq2Seq RNNs and ARIMA models for
Cryptocurrency Prediction: A Comparative Study. In Proceedings of the SIGKDD Workshop
on Fintech (SIGKDD Fintech’18), London, UK, 19–23 August 2018.

25. Rehman, M.U.; Apergis, N. Determining the predictive power between cryptocurrencies and
real time commodity futures: Evidence from quantile causality tests. Resour. Policy 2019

26. Kethineni, S.; Cao, Y. The Rise in Popularity of Cryptocurrency and Associated Criminal
Activity. Int. Crim. Justice Rev. 2019

27. Mohanty P, Patel D, Patel P, Roy S (2018) Predicting fluctuations in cryptocurrencies’ price
using users’ comments and real-time prices. In: 2018 7th international conference on reliability,
infocom technologies and optimization (Trends and Future Directions) (ICRITO), Noida, India
RE-2022-260878-plag-report
ORIGINALITY REPORT

8 %
SIMILARITY INDEX
4%
INTERNET SOURCES
2%
PUBLICATIONS
1%
STUDENT PAPERS

PRIMARY SOURCES

1
dspace.lpu.in:8080
Internet Source 2%
2
www.ijraset.com
Internet Source 1%
3
www.ijisrt.com
Internet Source <1%
4 R. Vijaya Saraswathi, Swathi Bindhu Bollina,
Rachana Bongu, Ankitha Cherukuru, Nikitha
<1%
Chintala. "A Novel LSTM based Approach for
Crypto Currency Price Prediction", 2023
International Conference on Sustainable
Communication Networks and Application
(ICSCNA), 2023
Publication

5
Submitted to Cardiff University
Student Paper <1%
6
Submitted to University of East London
Student Paper <1%
7
etd.aau.edu.et
Internet Source <1%
8
Submitted to Merrimack College
Student Paper <1%

9
Submitted to University of Kent at Canterbury
Student Paper <1%
dergipark.org.tr
Internet Source <1%
Submitted to University of York
Student Paper <1%
Submitted to Nottingham Trent University
Student Paper <1%
Submitted to Napier University
Student Paper <1%
Submitted to Unity College
Student Paper <1%
thedailycpa.com
Internet Source <1%
iimmun.ru
Internet Source <1%
eprints.staffs.ac.uk
Internet Source <1%
Submitted to Liverpool John Moores
University
<1%
Student Paper

easychair.org
Internet Source
<1%

20
fastercapital.com <1%
Internet Source

21
mydataroad.com <1%
Internet Source

22
Ton Duc Thang University <1%
Publication

Exclude quotes On Exclude matches Off


Exclude bibliography On

GENERAL

You might also like