Abstract:
The 2023 presidential election in Nigeria presented a contest that differed from previous elections as it presented four leading candidates
that all had huge potentials to win, thus making prediction of the outcomes by mere speculations difficult. Consequently, this article
implemented sentiment analysis using machine learning (ML) techniques to harvest data on Twitter and analyzed it to provide insights
into the outcome of the election. The Logistics Regression and Naïve Bayes ML algorithm were used. The results showed that Logistic
Regression has more promise for accuracy and performance as it provides a 97% accuracy and between 94% to 98% performance on
precision, recall and F1-Score metrics. The observable pattern on the data analyzed was that each candidate had a day that they reached
their summit in Twitter popularity. Findings showed that these peak days were associated with candidates’ key activities during their
campaigns. For instance, two of the candidates had their peak days when they spoke at the Chatham House in the UK. The other two
had theirs when they engaged some influential groups within the country. A comparison of the prediction results with the actual election
results however, showed a 25% accuracy as only one candidate maintained the same position in the prediction and the actual results.
The implication is that other factors would have influenced the outcome of the election as data collection for the prediction was
completed three weeks before the election.