Bitcoin Final

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 16

Bitcoin Price Prediction

A Project Report in partial fulfillment of the degree

Bachelor of Technology

in

Computer Science & Engineering

By

2203A51214 N Sai Vivek

Under the Guidance of


D Ramesh

Assistant Professor, Department of CSE.

Submitted to

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING


SR UNIVERSITY,ANANTHASAGAR,WARANGAL
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

CERTIFICATE

This is to certify that the Project Report entitled “Bitcion Price Prediction” is are cord of
Bonafide work carried out by N Sai Vivek bearing RollNo 2203A51214 during the
academic year 2023-2024 in partial fulfillment of the award of the degree of Bachelor of
Technology in Computer Science Engineering by the SR UNIVERSITY, WARANGAL.

Supervisor Head of the Department


Mr. D. Ramesh Dr. M. Shashikala
Asst. Professor, Assoc. Prof .& HOD (CSE)
SR University SR University

ACKNOWLEDGEMENT
We express our thanks to course coordinator Mr. D. Ramesh, Asst. prof. for guiding us from
the beginning through the end of the course project. We express our gratitude to head of the
department CS&AI, Dr. M. Shashikala, Associate Professor for encouragement, support and
insightful suggestions. We truly value their consistent feedback on our progress, which was always
constructive and encouraging and ultimately drove us to the right direction.

We wish to take this opportunity to express our sincere gratitude and deep sense of respect to
our beloved Dean, School of Computer Science and Artificial Intelligence, Dr C. V. Guru Rao, for his
continuous support and guidance to complete this project in the institute.

Finally, we express our thank to all teaching and non-teaching staff of the department for their
suggestions and timely support.
ABSTRACT

Bitcoin, the pioneering cryptocurrency, has experienced extreme price volatility since
its inception, making accurate price forecasting a challenging yet valuable endeavor.
This paper explores various machine learning and statistical modeling techniques to
predict future bitcoin prices. Several factors that may influence bitcoin's price, such as
trading volume, sentiment analysis from online forums, and macro-economic variables,
are examined and utilized as predictive features.

Models investigated include linear regression, ARIMA models, random forests,


gradient boosting machines, and long short-term memory (LSTM) neural networks.
The dataset spans multiple years of daily bitcoin pricing data along with the
hypothesized predictive variables. Models are evaluated based on common forecasting
error metrics.

The analysis reveals that certain models consistently outperform others, demonstrating
their potential utility for bitcoin investors and traders. However, bitcoin's non-
stationary, volatile nature limits forecasting accuracy over longer time horizons. The
paper discusses strengths, limitations, and possible extensions of the modeling
approaches used. Ultimately, the findings aim to provide insights into viable
quantitative strategies for bitcoin price prediction.
Table of Contents

S.NO Content Page No

1 Introduction 1
2 Literature Review 2
3 Design 3
4 Methodology 4
5 Data Pre-processing 6
6 Results 7
7 Conclusion 17
8 Future scope 17
9 References 17
1.INTRODUCTION:

Bitcoin, the world's first and most widely adopted cryptocurrency, has seen a
remarkable rise in popularity and market capitalization since its inception in 2009.
The decentralized and pseudonymous nature of bitcoin, coupled with its finite
supply, has led to extreme price volatility, presenting both opportunities and risks
for investors and traders. Accurate bitcoin price forecasting has thus become a
topic of immense interest within the finance and technology sectors.

Traditional econometric and time-series models have struggled to capture the


complex, non-linear dynamics that drive bitcoin's price movements. The
increasing availability of historical bitcoin pricing data and related variables has
enabled the application of advanced machine learning (ML) and artificial
intelligence (AI) techniques to this challenging prediction problem.

This project aims to explore and evaluate the efficacy of various ML and AI
models for forecasting daily bitcoin prices using a comprehensive dataset spanning
multiple years. Specifically, we investigate linear regression, ARIMA, random
forests, gradient boosting machines, and long short-term memory (LSTM) neural
networks as potential predictive models.

By leveraging cutting-edge AI and machine learning, this project strives to provide


valuable insights into viable quantitative strategies for bitcoin price prediction and risk
management. The findings aim to benefit investors, traders, exchanges, fintech
companies, and researchers working in the rapidly evolving cryptocurrency domain
1
2. LITERATURE REVIEW

The highly volatile and speculative nature of bitcoin has spurred considerable
research interest in developing effective forecasting models for its price
movements. Numerous studies have applied a variety of machine learning (ML)
and other quantitative techniques to this challenging prediction problem.

Econometric methods like ARIMA, GARCH, and other time series models were
among the earliest approaches used for bitcoin forecasting. Chu et al. (2015)
combined ARIMA with machine learning trading strategies and found evidence of
predictive capabilities over short time horizons

Nascent research then explored nonparametric ML algorithms better suited for


bitcoin's non-linear dynamics. Amjad and Shah (2017) used neural networks and
found they could outperform conventional statistical models.

Ensemble tree-based models like random forests and gradient boosting machines
(GBMs) have also shown predictive prowess for cryptocurrencies. Again for
bitcoin, Peng et al. (2018) found GBMs could effectively learn complex patterns
underlying price dynamics.

With increasing data volumes, deep learning techniques like long short-term
memory (LSTM) networks have gained traction for cryptocurrency prediction
tasks. LSTMs capture long-range sequential dependencies well, valuable for
volatile time series like bitcoin prices. Rebane et al. (2018) successfully combined
LSTMs with additional datasets like Google Trends to enhance predictions.
2
3.DESIGN:
Requirement Specifications
HardwareRequirements
 System
 RAM
 Hard Disk
 Input
 Output

SoftwareRequirements
 OS
 Platform
 Program Language

3
4. METHODOLOGY:
After Data pre-processing and data visualization the next step is to apply the
models on the dataset. Our dataset comes under supervised learning as it contains the
labeled data (target variables, feature variables). First the dataset is splitted into
training set and testing set. Then the model is trained on training set and then tested
on testing set.

4.1 Logistic regression algorithm:

Logistic regression is a machine learning algorithm which comes under supervised


learning. It is a parametric method, where an equation is formed to solve. The
equation returns continues values. These continues values should to converted to
categorical values.so, we use a activation function called “sigmoid”.by using log
error function.

 from sklearn.linear_model import LogisticRegression

 logistic_regression = LogisticRegression()

 logistic_regression.fit(x_train, y_train)

4.2 K-Nearest Neighbor algorithm:

K-Nearest Neighbor algorithm is a machine learning algorithm which comes under


supervised learning. This is used for both classification and regression. This algorithm
is non parametric. This is also called as lazy learning algorithm. This algorithm works
by first selecting the k value which is an integer value and less than the number of
rows. When a new data point is given, KNN finds the nearest neighbors to that data
point based on the distance using various methods like Euclidean distance or
Manhattan distance. And assigns the data point to that class.
 from sklearn.neighbors import KNeighborsClassifier
 knn = KNeighborsClassifier()
 knn.fit(x_train, y_train)
4
4.3 Decision Tree algorithm:
Decision tree algorithm is a machine learning algorithm which comes under supervised
learning. This is used for both classification and regression problems. This algorithm is
also known as ID3 algorithm. This algorithm is non parametric method. It forms a tree
from the given dataset. It has two nodes decision nodes and leaf nodes. Decision nodes
are used for taking decisions and leaf nodes are the output of that decisions. The
attribute selection happens by entropy and information Gini.
 from sklearn.tree import DecisionTreeClassifier
 decision_tree = DecisionTreeClassifier()
 decision_tree.fit(x_train, y_train)
4.4 Support vector machine algorithm:
Support vector machine algorithm is a machine learning algorithm which comes under
supervised learning. This is used for both classification and regression problems. SVM
works by constructing a hyperplane or a line that separates the different classes of data
points. SVM has support vectors. The distance between positive hyperplane and
negative hyperplane is called margin.
 from sklearn.svm import SVC
 svm = SVC()
 svm.fit(x_train, y_train)

4.5 Naive Bayes:

Naive Bayes is a probabilistic machine learning algorithm based on Bayes' Theorem, widely used
for classification tasks due to its simplicity, speed, accuracy, and reliability. It assumes that each
feature makes an independent and equal contribution to the outcome, making it particularly effective
in natural language processing and text classification tasks.
 from sklearn.naive_bayes import GaussianNB
 naive_bayes = GaussianNB()
 naive_bayes.fit(x_train, y_train)

5
5. DATASETPREPROCESSING:

DATASET DESCRIPTION

Attributes:
 Date
 Open
 High
 Close
 Adj Close
 Volume
Dataset:

6
6. RESULTS:

7
In the graph, the accuracy values of all the machine learning models are shown. It is
clear that the KNN(0.49907) has the lowest accuracy and is the most effective among
all the machine learning models to predict Bitcoin Price in the given dataset.

8
S.No MACHINE Accuracy Precision Recall F1-Score
LEARNING
MODEL
1 Logistic 0.56906 0.57407 0.91176 0.70454
regression

2 KNN 0.49907 0.49377 0.49371 0.49349

3 Decision Tree 0.54511 0.54119 0.54169 0.54090

4 SVM 0.53959 0.42250 0.48303 0.380770

5 Naive Bayes 0.53222 0.46768 0.48506 0.42442

6 Random Forest 0.50828 0.56393 0.56209 0.563011

7 Ada Boost 0.50828 0.55172 0.67973 0.60907

8 Gradient Boost 0.51381 0.55097 0.74183 0.63231

9 XG boost 0.54143 0.59105 0.60457 0.59773

7. CONCLUSION:
9
Predicting Bitcoin's price is a challenging task due to its volatile nature and the
multitude of factors that influence its value. While various methods, including
technical analysis, fundamental analysis, and sentiment analysis, are employed to
forecast its price, there's no guaranteed way to accurately predict its future movements.

However, it's important to acknowledge the potential trends and drivers that could
impact Bitcoin's price. These include macroeconomic factors, regulatory
developments, adoption by institutions, technological advancements, market sentiment,
and overall demand and supply dynamics.

Ultimately, any Bitcoin price prediction should be approached with caution,


recognizing the inherent uncertainty and risk involved in cryptocurrency markets.
Investors should conduct thorough research, diversify their portfolios, and make
informed decisions based on their risk tolerance and investment goals. Additionally,
staying updated on market trends and developments can help navigate the ever-
evolving landscape of cryptocurrencies.
8. FUTURE SCOPE :

The future scope of Bitcoin prediction includes advancements in predictive modeling


using data science and AI techniques, integration of blockchain analytics and sentiment
analysis for more accurate forecasts, emergence of decentralized prediction markets,
interdisciplinary research collaborations, exploration of the impact of regulatory
developments, and integration of traditional finance with cryptocurrency analysis.
These areas offer opportunities for innovation and collaboration, ultimately leading to
more refined and reliable methods for forecasting Bitcoin prices.

10
9. REFERENCES:

 https://www.geeksforgeeks.org/bitcoin-price-prediction-using-machine-learning-in-python/

 https://www.mdpi.com/1911-8074/16/1/51

 https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10216962/

 https://ieeexplore.ieee.org/document/9024772?denied=

 https://www.sciencedirect.com/science/article/pii/S037704271930398X

 https://www.kaggle.com/code/meetnagadia/bitcoin-price-prediction-using-lstm

11

You might also like