Price Prediction of Bitcoin using Machine Learning

DOI : 10.17577/IJERTCONV10IS12012

Download Full-Text PDF Cite this Publication

Text Only Version

Price Prediction of Bitcoin using Machine Learning

Yashaswini D1, Shravya K H2, Zaibah Shafaq M3, Nikitha V4

1,2,3 CSE Department, Sri Krishna Institute of Technology, Blore-560090, India

4 Faculty CSE Department, Sri Krishna Institute of Technology, Blore-560090, India

Abstract:- The objective of this paper is to determine the predictable price of Bitcoin by machine learning. This study shows RNN learning model on the basis of LSTM, which analyzes the previous prices of a bitcoin and predicts the next one. With this project, we try to predict the price of a bitcoin accurately by taking the various parameters that affect the Bitcoin value. As the result of the experiment, the ML proposes not only that after analyzing the graphs of error rates, but also that as learning goes over, the processing efficiency of its neural network gets better for more accuracy.

Keywords: Recurrent neural network, Bitcoin, Bitcoin prediction, cryptocurrency, generalized linear model (GLM), machine learning.

for 30, and 120 twinkles followed by performing GLM Random Forest on the datasets which produces three direct models. These three models are linearly combined to prognosticate the price of

Bitcoin. According to [2] the author is analysing what has been done to prognosticate the U.S. stock request. The conclusion of his work is the mean square error of the vaticination network was as large as

the standard divagation of the redundant return. Still, the author is furnishing substantiation that

several introductory fiscal and profitable factors have prop hetic power for the request redundant return.



In 3 rather of directly reading the unborn price of the stock the authors prognosticate trend of the stock the trend can be

Bitcoin is a decentralized electronic currency system, which after its development by Satoshi Nakamoto brought about a huge shift in the financial system. It reflects an advancement in IT that is focused on peer to peer networks and crypto- graphic protocols. Bitcoin, because of its decentralized existence and electronic process, is not regulated or controlled by any government or bank. Bitcoin's main aim, or goal, is to promote goods and services transactions. Bitcoin has evolved immensely and managed to attract vast numbers of users, gaining immense popularity because of its regular media mention and dissemination. Because of its popularity, the Bitcoin price, which is constantly fluctuating in real-time like a stock exchange, it's very curious to create a model that can predict Bitcoin's price on real-time using internet social media data. If it can be predicted at a reasonable degree of precision, it can be useful for investors, business people, banks, organizations, etc. that use Bitcoin for transactions.


The bitcoins value varies just like a stock albeit else there are number of algorithms used on stock request data for price vaticination still the parameters affecting bitcoin are different thus, its necessary to prognosticate the value of a bitcoin so that correct investment opinions can be made. The price of bitcoin doesnt depend on the business events or intermediating government unlike stock request. Therefore, to prognosticate the value we feel its necessary to work machine literacy technology to prognosticate the price of bitcoin.

II. Background Study (Literature)

Bitcoin is a new technology hence presently there are many price vaticination models available. [1], deals with diurnal time series data, 10- nanosecond and 10-alternate time-interval data. They've created three time series data sets

considered as a pattern they perform both short term prognostications day or week prognostications and also long- term prognostications months they set up that the ultimate produced better results with 79 delicacy another intriguing approach the paper reflects is the performance evaluation criteria of the network rested on the prognosticated affair the performance evaluation algorithm decides to either buy sell or hold the stock from 4 a comparison between multi- caste perceptron mlp andnon-direct autoregressive exogenous narx model is made they conclude that mlp can also be used for stock request vaticination indeed though it does nt outperform narx model in price vaticination the authors made use of matlabs neural network toolbox to make and estimate the performance of the network.


    We need a time stamp on the price of bitcoin and on the tweets to do time series analysis weve used apis and a little bit of web scraping for the collection of tweets weve collected tweets for 60 days starting from the 12th of march 2018 to the 12th of may the main reason for choosing the below time period is within this time price of bitcoin observed soaring and falling down as well in which gives us to estimate our model effectively figure 1 illustrates the price movements of bitcoin at the below time period

    The dataset given has 92550 tweets that were posted almost every minute within the time period mentioned above.

    The dataset is a combination of expressions, emoticons, symbols, URLs, and user's mentions. Raw tweets scraped from twitter usually give rise to a noisy dataset. This is because of the casual nature of social media use by people.


    To evaluate our proposed model, we chose one of the machine learning algorithms, called Random Forest

    Regression. By comparing other machine learning algorithms, the Random Forest Regression is quite effective with working a different kind of inputs that has not relationships with each other. The algorithm has advantages in predicting future outputs as well. We use sentiment analyzing score and history price of Bitcoin as an input data and implemented a random forest algorithm by using RandomForestClassifier from sklearn.ensemble provided by scikit-learn. Presence features performed better than frequency though the improvement was not substantial. We present the summary results of

    our models prediction as two line diagrams in Figure 2. The first line diagram is actual Bitcoin price movements in the above specified time. period and the second one is a diagram made by our prediction models output data.

    By considering defining the delicacy of the vaticination we checked the models labors and made computations for assessing the models performance. We tried to calculate the difference() between every single vaticination result with the separate close price of bitcoin() by abating to each other and taking an absolute value : =| -| (1)

    By looking at all() results we set up the stylish maximum error on vaticination, the stylish minimal error on vaticination and the normal of error all results are shown in Table 1.






    Number of tweets



    Number of prediction data



    Maximum value of error (%)



    Minimum value of error (%)



    Average of error (%)


    Table 1. Statistics of errors on prediction:

    Data described in Table 1 shows, during the vaticination process our model lost further than 10000 data that can be useful for better performance. Modules prognosticated with 43.83% error most end with minimal21.84% error delicacy.


Analysis of tweet sentiment is an important field of price soothsaying studies. Because of the large quantum of news updates per nanosecond about Bitcoin, using Twitter in the sentiment analysis for Bitcoin is getting a significant step for utmost experimenters. Textbook mining and bracket ways on twitter data are thus demanded which can prognosticate the stylish sentiment.

As unborn exploration, developing a special Bitcoin sentiment wordbook could ameliorate the connection between the sentiment analysis and the Bitcoin price change considering other features similar as hashtags, Twitter druggies, number of tweets and emoticons.


We would like to thank Dr. Shantharam Nayak for his valuable suggestion, expert advice and moral support in the process of preparing this paper.


[1] S. Velankar, S. Valecha and S. Maji, "Bitcoin price prophecy using machine learning," 2018 20th International Conference on Advanced Communication Technology (ICACT), 2018, pp. 144-147, doi: 10.23919/ICACT.2018.8323676.

[2] S. McNally, J. Roche and S. Caton, "Predicting the Price of Bitcoin Using Machine Learning," 2018 26th Euromicro International Conference on Parallel, Distributed and Network-based Processing (PDP), 2018, pp. 339-343, doi: 10.1109/PDP2018.2018.00060.

[3] N. P, R. J. Tom, P. Gupta, A. Shanthini, V. M. John and V. Sharma, "Prediction of Bitcoin Price Using Bi-LSTM Network," 2021 International Conference on Computer Communication and Informatics (ICCCI), 2021, pp. 1-5, doi: 10.1109/ICCCI50826.2021.9402427.

[4] J. Luo, "Bitcoin price prophecy in the time of COVID-19," 2020 Management Science Informatization and Economic Innovation Development Conference (MSIEID), 2020, pp.243- 247, doi: 10.1109/MSIEID52046.2020.00050.

[5] A. Demir, B. N. Aklotu, Z. Kadirolu and A. engür, "Bitcoin Price Prediction Using Machine Learning Methods," 2019 1st International Informatics and Software Engineering Conference (UBMYK), 2019, pp. 1-4, doi: 10.1109/UBMYK48245.2019.8965445.

[6] M. Shin, D. Mohaisen and J. Kim, "Bitcoin Price Forecasting via Ensemble-based LSTM Deep Learning Networks," 2021 International Conference on Information Networking (ICOIN), 2021, pp. 603-608, doi: 10.1109/ICOIN50884.2021.9333853.

[7] A. Mittal, V. Dhiman, A. Singh and C. Prakash, "Short-Term Bitcoin Price Fluctuation Prediction Using Social Media and Web Search Data," 2019 Twelfth International Conference on Contemporary Computing (IC3), 2019, pp. 1-6, doi: 10.1109/IC3.2019.8844899.

[8] G. Serafini et al., "Sentiment-Driven Price prophecy of the Bitcoin based on Statistical and Deep Learning Approaches," 2020 International Joint Conference on Neural Networks (IJCNN), 2020, pp. 1-8, doi: 10.1109/IJCNN48605.2020.9206704.

[9] S. Tandon, S. Tripathi, P. Saraswat and C. Dabas, "Bitcoin Price auguring using LSTM and 10-Fold Cross validation," 2019 International Conference on Signal Processing and

Communication (ICSC), 2019, pp. 323-328, doi: 10.1109/ICSC45622.2019.8938251.

[10] L. Li, A. Arab, J. Liu, J. Liu and Z. Han, "Bitcoin Options Pricing Using LSTM-Based Prediction Model and Blockchain Statistics," 2019 IEEE International Conference on Blockchain (Blockchain), 2019, pp. 67-74, doi: 10.1109/Blockchain.2019.00018.

[11] D. R. Pant, P. Neupane, A. Poudel, A. K. Pokhrel and B. K. Lama, "Recurrent Neural Network Based Bitcoin Price Prediction by Twitter Sentiment Analysis," 2018 IEEE 3rd International Conference on Computing, Communication and Security (ICCCS), 2018, pp. 128-132, doi: 10.1109/CCCS.2018.8586824.

[12] O. Sattarov, H. S. Jeon, R. Oh and J. D. Lee, "Forecasting Bitcoin Price Fluctuation by Twitter Sentiment Analysis," 2020 International Conference on Information Science and Communications Technologies (ICISCT), 2020, pp.1-4, doi: 10.1109/ICISCT50599.2020.9351527.

[13 ] 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),2019, pp. 206-210, doi:10.1109/ICECOS47637.2019.8984499.

[14] P. Mohanty, D.Patel, P.Patel and S.Roy, "Predicting Fluctuations in Cryptocurrencies' Price using users' Comments and Real-time Prices," 2018 7th International Conference on Reliability, Infocom Technologies and Optimization (Trends and Future Directions)(ICRITO), 2018, pp. 477-482, doi: 10.1109/ICRITO.2018.8748792.

[15] R. Albariqi and E. Winarko, "Prediction of Bitcoin Price Change using Neural Networks,"

2020 International Conference on Smart Technology and Applications(ICoSTA), 2020, pp. 1-4, doi: 10.1109/ICoSTA48221.2020.1570610936.