TY - EJOU AU - Naeem, Samreen AU - Mashwani, Wali Khan AU - Ali, Aqib AU - Uddin, M. Irfan AU - Mahmoud, Marwan AU - Jamal, Farrukh AU - Chesneau, Christophe TI - Machine Learning-based USD/PKR Exchange Rate Forecasting Using Sentiment Analysis of Twitter Data T2 - Computers, Materials \& Continua PY - 2021 VL - 67 IS - 3 SN - 1546-2226 AB - This study proposes an approach based on machine learning to forecast currency exchange rates by applying sentiment analysis to messages on Twitter (called tweets). A dataset of the exchange rates between the United States Dollar (USD) and the Pakistani Rupee (PKR) was formed by collecting information from a forex website as well as a collection of tweets from the business community in Pakistan containing finance-related words. The dataset was collected in raw form, and was subjected to natural language processing by way of data preprocessing. Response variable labeling was then applied to the standardized dataset, where the response variables were divided into two classes: “1” indicated an increase in the exchange rate and “ −1” indicated a decrease in it. To better represent the dataset, we used linear discriminant analysis and principal component analysis to visualize the data in three-dimensional vector space. Clusters that were obtained using a sampling approach were then used for data optimization. Five machine learning classifiers—the simple logistic classifier, the random forest, bagging, naïve Bayes, and the support vector machine—were applied to the optimized dataset. The results show that the simple logistic classifier yielded the highest accuracy of 82.14% for the USD and the PKR exchange rates forecasting. KW - Machine learning; exchange rate; sentiment analysis; linear discriminant analysis; principal component analysis; simple logistic DO - 10.32604/cmc.2021.015872