Abstract
The implementation of machine learning (ML) algorithms to predict stock price
direction has become an extensively studied and challenging problem. It has gained
attention from researchers in several fields, such as economics, finance, mathematics
and computer science. These prediction techniques have become so popular that
investors have begun to rely on the models proposed by many researchers. This paper
attempts to predict the stock price direction of the banking sector in South Africa. Daily
data from the Johannesburg Stock Exchange was collected for the five biggest banks
in South Africa from 2012 to 2022, namely, FirstRand, Standard Bank, Absa, Nedbank
and Capitec. As a new topic regarding the South African banking sector stock market,
this study compares single classifiers, homogeneous ensemble classifiers and
heterogeneous classifiers. The study uses ML algorithms, because as the data
changes, these algorithms adapt their predictions accordingly. Machine learning is
thus able to learn and adapt from any amount of data, which ensures that the
predictions are as accurate as possible and up-to-date. Ensemble methods combine
ML algorithms to improve the accuracy of predictions. This study also used bootstrap
aggregating (also known as bagging) and voting to create, respectively, the
homogeneous and heterogeneous classifiers. The results showed that the
heterogeneous ensemble classifier outperformed all other models. It appears to be a
suitable model to use for predicting the stock price direction of the banking sector in
South Africa.