Bitcoin Price Prediction Using Machine Learning Algorithms
RITESH PANDEY
Government Polytechnic College Betul M.P. India
Systematic Review
Keywords: SVR (RBF), LSTM Model, Linear Regression, KNN, Bitcoin, Random Forest, Prediction, Forecasting, Decision Trees
Posted Date: January 25th, 2025
DOI: [Link]
License: This work is licensed under a Creative Commons Attribution 4.0 International License. Read Full License
Additional Declarations: No competing interests reported.
Page 1/9
Abstract
The rising popularity of cryptocurrencies has led to increased interest in predicting their prices, particularly in the case of
Bitcoin due to its volatility and complexity. While past research has used machine learning to improve Bitcoin price prediction
accuracy, there has been limited focus on exploring diverse modeling techniques for datasets with varying structures and
dimensions. This study aims to forecast Bitcoin prices using machine learning techniques by categorizing them into daily
prices and high-frequency prices. The project specifically employs the Random Forest Classifier algorithm to predict Bitcoin
prices using historical data from July 2010 to May 2023. The dataset undergoes preprocessing and feature engineering to
extract relevant features for the model. The trained algorithm is then optimized through hyperparameter tuning. Additionally,
a simulation dashboard is created using Flask, a popular web framework, to allow users to evaluate different machine
learning algorithms for predicting Bitcoin prices. The results of the project demonstrate that the Random Forest Classifier
algorithm achieved 99% accuracy in predicting Bitcoin prices, highlighting the effectiveness of machine learning techniques
in this context.
Introduction
Bitcoin is a cryptocurrency used worldwide for digital payments or investment. It is decentralized, meaning it is not owned by
anyone. Bitcoin transactions are easy and not tied to any country. People can buy or sell Bitcoins using different currencies
through marketplaces known as "bitcoin exchanges." The largest Bitcoin exchange is Mt. Gox. Bitcoins are stored in a digital
wallet, which is like a virtual bank account. Transactions are stored in a decentralized ledger called a blockchain, providing
transparency, security, and resiliency by dispersing copies of the ledger over a network of computers. Each block in a chain
carries a reference to the one before it. The encrypted data in a blockchain provides security, and only wallet IDs are normally
made public, with user identities remaining anonymous.
LITERATURE SURVEY
(a)Automated bitcoin trading via machine learning algorithms
AUTHORS: I. Madan, S. Saluja, A. Zhao
In this project, we attempt to apply machine-learning algorithms to predict Bitcoin price. For the first phase of our
investigation, we aimed to understand and better identify daily trends in the Bitcoin market while gaining insight into optimal
features surrounding Bitcoin price. Our data set consists of over 25 features relating to the Bitcoin price and payment
network over the course of five years, recorded daily. Using this information we were able to predict the sign of the daily price
change with an accuracy of 98.7%. For the second phase of our investigation, we focused on the Bitcoin price data alone and
leveraged data at 10-minute and 10-second interval time points, as we saw an opportunity to evaluate price predictions at
varying levels of granularity and noisiness. By predicting the sign of the future change in price, we are modeling the price
prediction problem as a binomial classification task, experimenting with a custom algorithm that leverages both random
forests and generalized linear models. These results had 50-55% accuracy in predicting the sign of future price change using
10 minute time intervals.
(b)Deep learning-based feature engineering for stock price movement prediction
AUTHORS: W. Long, Z. Lu, and L. Cui
Stock price modeling and prediction have been challenging objectives for researchers and speculators because of noisy and
non-stationary characteristics of samples. With the growth in deep learning, the task of feature learning can be performed
more effectively by purposely designed network. In this paper, we propose a novel end-to-end model named multi-filters
neural network (MFNN) specifically for feature extraction on financial time series samples and price movement prediction
task. Both convolutional and recurrent neurons are integrated to build the multi-filters structure, so that the information from
Page 2/9
different feature spaces and market views can be obtained. We apply our MFNN for extreme market prediction and signal-
based trading simulation tasks on Chinese stock market index CSI 300. Experimental results show that our network
outperforms traditional machine learning models, statistical models, and single-structure(convolutional, recurrent, and
LSTM) networks in terms of the accuracy, profitability, and stability
PROPOSED SYSTEM
Predicting the future will always be on the top of the list of uses for machine learning algorithms. Here in this project we
have attempted to predict the prices of Bitcoin using Random Forest Classifier. This work focuses on the development
of project based learning in the field of computer science engineering, by taking into account the problem definition,
progression, assessment and use of hands on activities based on use of learning algorithm to develop application
In this system, we investigated machine learning technique based upon sample characteristics of sample and
dimension to predict Bitcoin price. While most previous works simply leverage machine learning algorithms in Bitcoin
price prediction, we show that the sample’s granularity and feature dimensions should be considered.
Random forest model use an ensemble of decision trees for various tasks to obtain a better classification result and are
a popular approach. The use of decision trees is one of the basic machine learning methods and is used to solve a wide
range of problems in classification. Decision trees adopt a tree structure to recursively partition the feature space, with
each node continuing to split to maximize purity until the nodes only contain single-class samples. These pure nodes
are called leaf nodes. When a test sample is an input into a decision tree, it can be traced down to the leaf node and a
class label can be assigned. By running a bootstrap aggregation (or bagging), a random subset of the whole feature
space is assigned to the growth of each tree.
PROPOSED MODEL
In this project, we aimed to predict Bitcoin prices using a Random Forest Classifier. The focus was on project-based learning
in the field of computer science engineering, covering problem definition, progression, assessment, and hands-on activities
using learning algorithms to develop applications. We explored a machine learning technique based on sample
characteristics and dimensions to predict Bitcoin prices. This study emphasizes the importance of considering sample
granularity and feature dimensions in Bitcoin price prediction, going beyond the typical application of machine learning
methods. To improve the precision of Bitcoin price prediction models, the study highlights the significance of thorough data
samples and carefully selected features. Random Forest models use an ensemble of decision trees to achieve better
classification results and are a popular approach. Decision trees are fundamental machine learning methods used to solve a
wide range of classification problems.
PREDICTION TECHNIQUES
A. Linear regression model :-
In linear regression is a linear approach to modeling the relationship between a dependent variable and independent
variables. The case of linear variable is called simple linear regression. In this paper I am using the linear regression model
for relationship between a dependent variable and one or more independent variables [1].
B. RBF SVMs :-
In general, the RBF kernel is a reasonable first choice. This kernel nonlinearly maps samples into a higher dimensional space,
so it, unlike the linear kernel, can handle the case when the relation between class labels and attributes is nonlinear.
Furthermore, the linear kernel is a special case of RBF since the linear kernel with a penalty parameter has the same
performance as the RBF kernel with some parameters (C, γ). In addition, the sigmoid kernel behaves like RBF for certain
parameters [02]. The second reason is the number of hyperparameters which influences the complexity of model selection.
Page 3/9
The polynomial kernel has more hyperparameters than the RBF kernel. Finally, the RBF kernel has fewer numerical
difficulties. One key point is 0 < Kij ≤ 1 in contrast to polynomial kernels of which kernel values may go to infinity (γxi T xj + r >
1) or zero (γxi T xj + r < 1) while the degree is large. Moreover, we must note that the sigmoid kernel is not valid (i.e. not the
inner product of two vectors) under some parameters [02]. There are some situations where the RBF kernel is not suitable. In
particular, when the number of features is very large, one may just use the linear kernel [02].
C. Random Forests :-
Random Forests get the outfit learning framework where distinctive weak understudies are merged to make a strong
understudy. It is a meta estimator that fits various decision tree classifiers on various sub-primer of the enlightening
assortment and use averaging to improve the farsighted accuracy and authority over fitting. The sub-test size is reliably
proportional to the rule data test [01]. We used the use gave by Scikit-see how to this. 1) Build three-time arrangement
informational indexes for 30, 60, and 120 minutes (180, 360, 720 information focuses individually) going before the present
information point at all focuses in time separately. 2) Run GLM/Random Forest on each of the two time series data sets
separately. 3) We get two separate linear models: M1,
M2 corresponding to each of the data sets. From M1, we can predict the price change at t, denoted
∆P1. Similarly, we have ∆P2 for M2.
D. kNN (k- Nearest Neighbors) :-
It very well may be utilized for both order and relapse issues. Be that as it may, it is all the more generally utilized in
characterization issues in the business [1]. K nearest neighbors is a straight forward calculation that stores every single
accessible case and arranges new cases by a lion's share vote of its k neighbors. The case being allotted to the class is
generally normal among its K closest neighbors estimated by a separation work. These separation capacities can be
Euclidean, Manhattan, Minkowski and Hamming separation. Initial three capacities are utilized for constant
capacity and fourth one (Hamming) for clear cut factors. On the off chance that K = 1, at that point the case is basically
relegated to the class of its closest neighbor. Now and again, picking K ends up being a test while performing kNN
displaying.
E. Decision Tree:-
This is one of my preferred calculation and I use it oftentimes. It is a kind of directed learning calculation that is for the most
part utilized for order issues. Shockingly, it works for both clear cut and consistent ward factors. In this calculation, we split
the populace into at least two homogeneous sets. This is done dependent on most huge properties/autonomous factors to
make as particular gatherings as could reasonably be expected [01].
F. Elastic Net :-
Several studies such as medicine, and economics interested in using time series datasets, where these datasets are often
non-stationary and non-linear simultaneously[03]. The traditional statistical methods assumed that the dataset should be
either stationary or linear, which led to a lack of effective techniques for extracting oscillatory patterns from the data. For
instance, Fourier decomposition (Titchmarsh, 1948) and wavelet decomposition (Chan, 1994) were limited by this
assumption. However, a recent method called empirical mode decomposition (EMD), proposed by Huang et al. (1998), aims
to decompose non-stationary and non-linear data while retaining the time domain. Unlike traditional methods, EMD does not
impose any restrictions or pre-conditions on the nature of the data, such as stationarity or linearity.
Elastic net (ELNET) regression analysis (Zou and Hastie, 2005) combines the characteristics of LASSO (Tibshirani, 1996) and
Ridge regression (Hoerl and Kennard, 1970)[03]. It is used to regularize and select the important predictor variables in order
to obtain a simple model with the most significant predictor variables, even when there is high multicollinearity between the
Page 4/9
predictors. ELNET can remove or select the predictor variables that have a high correlation in the final model and improve
prediction accuracy (Liu and Li, 2017).
G. LSTM Model :-
To construct an architecture that allows for constant error ow through special, self-connected units without the
disadvantages of the naive approach, we extend the constant error carrousel CEC embodied by the self-connected, linear
unit j from Section 3.2 by introducing additional features. A multiplicative input gate unit is introduced to protect the memory
contents stored in j from perturbation by irrelevant inputs. Likewise, a multiplicative output gate unit is introduced which
protects other units from perturbation by currently irrelevant memory contents stored in j [04].
IMPLEMENTATION
MODULES:
Data Collection
Dataset
Sequence Diagram
Model Selection
Evaluation Model
Prediction Result
1. Data Collection:
In the first module, we make the data collection process. Data collection process is the first real step towards the real
development of a machine learning model, collectingdata. This is a critical step that will cascade in how good the model will
be, the more and better data that we get, the better our model will perform. There are several techniques to collect the data,
like web scraping, manual interventions. Our dataset is placed in the project and it’s located in the model folder. The dataset
is referred from the popular investing website where all the researchers refer it. The following is the link to the dataset. Data
set Link:
[Link]
DATASET
The dataset consists of 4127 individual data. There are 7 columns in the dataset, which are described below.
Date - specifies trading date
Open - opening price
High - maximum price during the day Low - minimum price during the day Close - close price adjusted for splits
Volume - the number of shares that changed hands during a given day
Page 5/9
date Open High Low close Vol. Change %
0 18-Jul-10 0 0.1 0.1 0.10000 0.08K 0.00%
1 19-Jul-10 0.1 0.1 0.1 0.10000 0.57K 0.00%
2 20-Jul-10 0.1 0.1 0.1 0.10000 0.26K 0.00%
3 21-Jul-10 0.1 0.1 0.1 0.10000 0.58K 0.00%
4 22-Jul-10 0.1 0.1 0.1 0.10000 2.16K 0.00%
... ... ... ... ... ... ... ...
5051 31/03/2024 69647.78125 71377.78125 69624.86719 71333.64844 71333.64844 20050941373
5052 01/04/2024 71333.48438 71342.09375 68110.69531 69702.14844 69702.14844 34873527352
5053 02/04/2024 69705.02344 69708.38281 64586.59375 65446.97266 65446.97266 50705240709
5056 rows × 7 columns
2. Sequence Diagram:
A sequence diagram in Unified Modeling Language (UML) is a kind of interaction diagram that shows how processes operate
with one another and in what order. It is a construct of a Message Sequence Chart. Sequence diagrams are sometimes
called event diagrams, event scenarios, and timing diagrams.
3. Evaluation Model:
Following table displays the Mean Squared Error (MSE) for different models. A lower value indicates better performance:
4. Prediction Result:
The following table shows the original Bitcoin Price value of stock along with its predicted Bitcoin Price value on
Date: 04-04-2024.
CONCLUSION
"In summary, this project aimed to use machine learning techniques to predict the price of Bitcoin and assess the feasibility
of applying various modeling techniques to samples with different data structures and dimensional features. By using the
Random Forest Classifier algorithm, we were able to achieve 99% accuracy in predicting the price of Bitcoin. Additionally, we
created a simulation dashboard using Flask to assess the performance of different machine learning algorithms in
predicting Bitcoin prices. The dashboard provides a user-friendly platform for traders and researchers to compare the
accuracy and effectiveness of different models, making the model selection process more efficient and transparent. The
proposed system offers several advantages, including improved decision-making, time-saving, flexibility, and transparency.
The high accuracy of the model and the transparency of the simulation dashboard make this project a valuable contribution
to the crypto currency research community. Overall, this project demonstrates the potential of machine learning techniques
for predicting the price of Bitcoin and provides a reliable and efficient approach for traders and investors to make informed
decisions within the dynamic crypto currency market."
Declarations
Author Contribution
Page 6/9
Mr. Ritesh Pandey , In-HOD & Lecturer Department of Computer Science, Government Polytechnic College Betul ( M.P., India)
has reviewed and wrote the manuscript . he also prepared all the tables and figures in the manuscripts.
References
1. Lekkala Sreekanth Reddy, Dr.P. Sriramya,”A Research On Bitcoin Price Prediction Using Machine Learning Algorithms”
INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 9, ISSUE 04, APRIL 2020
ISSN22778616.
2. Vasileios Apostolidis-Afentoulis ” SVM CLASSIFICATION WITH LINEAR AND RBF KERNELS” RESEARCHGATE
DOI:10.13140/RG.2.1.3351.4083 .
3. Abdullah S. Al-Jawarneh, Mohd. Tahir Ismail, Ahmad M. Awajan “Elastic Net Regression and Empirical Mode
Decomposition for Enhancing the Accuracy of the Model Selection” DOI:10.33889/IJMEMS.2021.6.2.034 .
4. S. Velankar, S. Valecha and S. Maji, "Bitcoin price prediction using machine learning," 2018 20th International Conference
on Advanced Communication Technology (ICACT), Chuncheon, Korea (South), 2018, pp. 144-147, doi:
10.23919/ICACT.2018.8323676.
5. [Link]
6. [Link]
7. [Link]
Figures
Figure 1
result for bitcoin price using machine learning algorithm
Page 7/9
Figure 2
accuracy graph for machine learning algorithm
Figure 3
Legend not included with this version
Page 8/9
Figure 4
Legend not included with this version
Page 9/9