Logo Lanfrica
  • Home
  • Atlas
  • Insights
  • Docs
  • Sign in

© 2026 Lanfrica. All rights reserved. All copyrights of the resources shown on the Lanfrica website belong to the original copyright holders, unless explicitly stated otherwise.

idris10x/nigeria-presidential-election-prediction

Creator:
idr
Host:
A prediction of the Nigeria presidential election winner using social media data (Twitter). # Nigeria Presidential Election Prediction ### Overview This repository contains a sentiment analysis model that aims to predict the outcome of the Nigeria Presidential Election. The model uses tweets scraped from Twitter using Twint and the sentiment polarity of the tweets to make predictions. The model was built using scikit-learn. ### Data Collection The tweets were collected using Twint, an open-source Twitter scraping tool. The scraped tweets were preprocessed and the sentiment polarity was extracted using TextBlob. ### Modeling The sentiment polarity was used as the independent feature for building the model. The target variable was each candidate's tendency to win per tweet. The final model was tested using scikit-learn's MLPClassifier. ### Results Unfortunately, the model accuracy score was low (35.2%). This could be due to a number of reasons, such as the limited number of observations and the use of only one independent feature (polarity). ### Future Work This repository provides a starting point for anyone interested in using sentiment analysis for predicting the outcome of elections. There is a lot of room for improvement and anyone is welcome to contribute. Some suggestions for improving the model include: * Collecting more data to increase the number of observations * Adding additional independent features, such as word frequency, word bigrams, and n-grams * Using feature selection techniques to determine the most important features ### Conclusion Predicting the outcome of an election using sentiment analysis is a challenging task, but this repository provides a starting point for anyone interested in exploring this problem further. With more data, improved features, and different machine learning algorithms, it is possible to build a more accurate model.

Visit

github.com

Tasks

sentiment analysistext classification

Tags

election-predictionsentiment-analysis

Licenses

MIT

Similar

Amuda106/NIGERIA-2019-PRESIDENTIAL-ELECTION-RESULTNigeria's 2023 Presidential Election DatasetPresidential Election and Portfolio Selections in the Nigeria Stock ExchangeTwitter Discourse on the Pre-Presidential Election Campaign in NigeriaAnomalies in Nigeria Presidential Election Data and the Way ForwardZambian Presidential Election Analysis (2001-2016)

Amuda106/NIGERIA-2019-PRESIDENTIAL-ELECTION-RESULT

WEBMAP # NIGERIA-2019-PRESIDENTIAL-ELECTION-RESULT WEBMAP NIGERIA-2019-PRESIDENTIAL-ELECTION-RESULT

Nigeria's 2023 Presidential Election Dataset

This dataset contains tweets mined from August, 2022 to February, 2023 about Nigeria's 2023 presiden

Presidential Election and Portfolio Selections in the Nigeria Stock Exchange

This study seeks to investigate the effect of presidential elections on investors’ portfolio selecti

Twitter Discourse on the Pre-Presidential Election Campaign in Nigeria

Citizens political participation and engagement on various social media handles have made it neces

Anomalies in Nigeria Presidential Election Data and the Way Forward

Nigeria presently runs a presidential system of government and the Independent National Electoral Co

Zambian Presidential Election Analysis (2001-2016)

These data include Zambian presidential election data, Zambian census data, and Afrobarometer data f