IEEE Systems, Man and Cybernetics Magazine - April 2022 - 41
price-prediction models. However, with access to a larger
variety and volume of Bitcoin-related data and the increase
in computation power, several techniques have been
employed for predicting the Bitcoin price.
Sentiment analysis has helped in establishing correlations
between sentiments and Bitcoin price. Researchers
have demonstrated that the Bitcoin price can be predicted
by performing sentiment analysis on news articles [9]. Sentiments
expressed on social media platforms and networks
have also proven to be strong indicators of Bitcoin
price movements, with polarity indicating the direction of
the price movement [10], [11]. Similarly, a wide variety of
conventional machine learning algorithms along with neural
networks has been used by researchers to create priceprediction
models. Some of the algorithms used include
Recurrent Neural Network + LSTM + Autoregressive Integrated
Moving Average [2] and Convolutional Neural Network
+ LSTM + Gated Recurrent Unit [12].
To achieve better performance than that of conventional
machine learning models, ensemble machine learning
has been employed [13]. Furthermore, the usage of stacking-ensemble
learning and variational mode decomposition
has given better results than those of traditional
ensemble learning models [14]. While some research
works have shown the effect of a processor and parallelism
on the training time of machine learning models [2],
[15], the idea of employing distributed machine learning
with the help of specialized processors like TPUs to
develop price-prediction models has not been explored in
depth until now.
However, in many other domains, distributed machine
learning has proven effective in reducing training time and
latency. For example, a TPU-based high-speed object
tracking and prediction model has demonstrated better
performance than other architectures and accelerators
[16]. In addition, TPU-trained models were found to be
highly efficient in terms of computational time when
trained for facial emotion recognition [17] and magnetic
resonance image reconstruction [18]. Hence, to check the
efficiency of a TPU in accelerating the training process of
an LSTM-based price-prediction model, we employ it to
provide a distributed environment for the proposed model.
In this article, a TPU has been used to evaluate its efficiency
in accelerating the training process of LSTM-based
price-prediction models.
Methodology
In the proposed model, univariate time-series forecasting
is implemented on a CPU-based system using an LSTM network
architecture. The same method of time-series forecasting
is then implemented on a TPU-based system by
employing distributed machine learning. Initially, the data
are collected and preprocessed. The division of the data
into a training and a testing set is carried out after preprocessing.
Subsequently, an appropriate machine learning
algorithm is selected for the creation of a model (LSTM in
this case). The created model is trained using the training
data set. Finally, the performances of the CPU- and TPUbased
models are compared.
Data Preparation
The data set for training and testing the model was
acquired from Quandl [19]. Quandl is an online currency
platform and marketplace from which data about various
currencies can be acquired using a Quandl API. The data
set is made up of Bitcoin prices on 2,473 days (from 24 January
2014 to 1 November 2020). A univariate time-series
forecasting technique is used for the prediction of future
Bitcoin prices. For more accurate predictions, the weighted
price of Bitcoin is used.
The weighted price gives more insight into the movements
and fluctuations as it provides the average price of
the Bitcoin throughout the day. In the proposed method,
the weighted Bitcoin price of the previous days is used to
predict the weighted price of Bitcoin for the upcoming day.
The weighted price, W(P), is calculated by summing the
product of the traded volume and the corresponding trading
price. Subsequently, the summation is divided by the
total volume traded for the day as given in (1). Volume
denotes the total amount of asset (Bitcoin in this case)
bought or sold in a particular time frame. The weighted
price is calculated for each day that appears in the data set.
WPh
^ =
|^
TotalVolumeTradedinthe Day
Volume Traded TradingPrice
#
h
.
(1)
After the weighted price calculations, data preprocessing
is carried out to normalize the data set. Normalization of
the data set fits the data values into a common scale with no
effect on the range of difference that exists in the data. Minmax
normalization has been utilized in the proposed model,
where each data point is mapped to a particular value
between zero and one. The largest data point is mapped to
one, while the smallest data point is mapped to zero.
To obtain the normalized value z, the difference
between the data value x and the smallest data value
min(x) is divided by the difference between largest data
value max(x) and the smallest data value min(x), as can be
inferred from the following:
z =
maxmin
min
xx
xx
-
^
h^
h
^
h
.
(2)
After
normalization of the data set, it is split into training
and testing data; the training data are used to train the
model, and the testing data are used to measure the model
performance. For the proposed model, 70% of the data set
is used as training data and 30% as testing data.
Parallelization of the Model and TPU Usage
Following the preprocessing of the data set, the model is
parallelized and run on a TPU-based system. This is done to
April 2022 IEEE SYSTEMS, MAN, & CYBERNETICS MAGAZINE 41
IEEE Systems, Man and Cybernetics Magazine - April 2022
Table of Contents for the Digital Edition of IEEE Systems, Man and Cybernetics Magazine - April 2022
Contents
IEEE Systems, Man and Cybernetics Magazine - April 2022 - Cover1
IEEE Systems, Man and Cybernetics Magazine - April 2022 - Cover2
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 1
IEEE Systems, Man and Cybernetics Magazine - April 2022 - Contents
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 3
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 4
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 5
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 6
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 7
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 8
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 9
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 10
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 11
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 12
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 13
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 14
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 15
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 16
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 17
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 18
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 19
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 20
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 21
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 22
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 23
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 24
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 25
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 26
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 27
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 28
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 29
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 30
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 31
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 32
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 33
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 34
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 35
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 36
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 37
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 38
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 39
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 40
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 41
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 42
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 43
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 44
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 45
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 46
IEEE Systems, Man and Cybernetics Magazine - April 2022 - 47
IEEE Systems, Man and Cybernetics Magazine - April 2022 - Cover3
IEEE Systems, Man and Cybernetics Magazine - April 2022 - Cover4
https://www.nxtbook.com/nxtbooks/ieee/smc_202310
https://www.nxtbook.com/nxtbooks/ieee/smc_202307
https://www.nxtbook.com/nxtbooks/ieee/smc_202304
https://www.nxtbook.com/nxtbooks/ieee/smc_202301
https://www.nxtbook.com/nxtbooks/ieee/smc_202210
https://www.nxtbook.com/nxtbooks/ieee/smc_202207
https://www.nxtbook.com/nxtbooks/ieee/smc_202204
https://www.nxtbook.com/nxtbooks/ieee/smc_202201
https://www.nxtbook.com/nxtbooks/ieee/smc_202110
https://www.nxtbook.com/nxtbooks/ieee/smc_202107
https://www.nxtbook.com/nxtbooks/ieee/smc_202104
https://www.nxtbook.com/nxtbooks/ieee/smc_202101
https://www.nxtbook.com/nxtbooks/ieee/smc_202010
https://www.nxtbook.com/nxtbooks/ieee/smc_202007
https://www.nxtbook.com/nxtbooks/ieee/smc_202004
https://www.nxtbook.com/nxtbooks/ieee/smc_202001
https://www.nxtbook.com/nxtbooks/ieee/smc_201910
https://www.nxtbook.com/nxtbooks/ieee/smc_201907
https://www.nxtbook.com/nxtbooks/ieee/smc_201904
https://www.nxtbook.com/nxtbooks/ieee/smc_201901
https://www.nxtbook.com/nxtbooks/ieee/smc_201810
https://www.nxtbook.com/nxtbooks/ieee/smc_201807
https://www.nxtbook.com/nxtbooks/ieee/smc_201804
https://www.nxtbook.com/nxtbooks/ieee/smc_201801
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_1017
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0717
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0417
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0117
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_1016
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0716
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0416
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0116
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_1015
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0715
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0415
https://www.nxtbook.com/nxtbooks/ieee/systems_man_cybernetics_0115
https://www.nxtbookmedia.com