Predicting satisfaction with democracy in Brazil considering data form an opinion survey




Machine learning, Democracy, Classification, Satisfaction


Purpose This article compared machine learning algorithms in the context of satisfaction with democracy in Brazil. The models were trained with data from the Latinobarómetro survey, a private non-profit institution.

Theoretical foundation – The Support Vector Classifier (SVC), Random Forest (RF), and Artificial Neural Networks (ANN) classification techniques were described, followed by evaluation metrics, such as accuracy, precision, recall, f1-score and the area under a receiver operating characteristic (auc-roc).

Methodology – The data set was cleaned and the questionnaire was reduced to variables related to the local democracy index (IDL). Then, attribute transformations were performed, hyperparameters were analyzed and subsets with different class balances were created to evaluate the performance of the classifiers in different scenarios. Also, the attributes that most contributed to satisfaction with democracy were analyzed.

Results – The best classifier was RF for the class of those dissatisfied with democracy, however, the ANN and SVC techniques obtained better results in the class of satisfied individuals. Evaluating the most important attributes for satisfaction with democracy, it was identified that they are related to the country's economic situation and political and governmental issues.

Research implications – The models created were mainly able to identify people dissatisfied with democracy. The most important variables in this context were economy performance, government, political positioning, and democracy. This indicates directions for future studies and enables the development of strategies to change the perception of dissatisfied individuals.

Originality/Value – Exploring data on democracy from the Latinobarómetro using machine learning techniques in the context of Brazil.

Keywords: Machine learning; Democracy; Classification; Satisfaction.


Aggarwal, C. C. (2018). Neural Networks and Deep Learning. In Neural Networks and Deep Learning. Springer International Publishing. DOI:

Albright, J. (2016, November 26). How Trump’s campaign used the new data-industrial complex to win the election. Https://Blogs.Lse.Ac.Uk/Usappblog/2016/11/26/How-Trumps-Campaign-Used-the-New-Data-Industrial-Complex-to-Win-the-Election/.

Ateca-Amestoy, V., Aguilar, A. C., & Moro-Egido, A. I. (2014). Social Interactions and Life Satisfaction: Evidence from Latin America. Journal of Happiness Studies, 15(3), 527–554. DOI:

Barredo Ibáñez, D. (2018). Religious Commitment, Subjective Income, and Satisfaction towards the Functioning of Democracy in Latin America. A Mediation Analysis Model Based on Latinobarómetro. Religions, 9(6), 198. DOI:

Berry, B. J. L., & Rodriguez, O. S. T. (2010). Dissatisfaction with Democracy: Evidence from the Latinobarómetro 2005. Journal of Politics in Latin America, 2(3), 129–142. DOI:

Bhojani, S., & Bhatt, N. (2016). Data Mining Techniques and Trends – A Review. Global Journal for Research Analysis, 5(5), 252–254.

Blagus, R., & Lusa, L. (2013). SMOTE for high-dimensional class-imbalanced data. BMC Bioinformatics, 14(1), 106. DOI:

Breiman, L. (2001). Random forests. Machine Learning, 45, 5–32. DOI:

Brito, K., & Adeodato, P. J. L. (2023). Machine learning for predicting elections in Latin America based on social media engagement and polls. Government Information Quarterly, 40(1), 101782. DOI:

Broderstadt, T. S. (2023) An Empirical Evaluation of Explanations for Political System Support. Political Research Quarterly, 76 (3). DOI:

Chawla, N. V. (2006). Data Mining for Imbalanced Datasets: An Overview. In Data Mining and Knowledge Discovery Handbook (pp. 853–867). Springer-Verlag. DOI:

Chawla, N. V., Bowyer, K. W., Hall, L. O., & Kegelmeyer, W. P. (2002). SMOTE: Synthetic Minority Over-sampling Technique. Journal of Artificial Intelligence Research, 16, 321–357. DOI:

Géron, A. (2019). Hands-on: Machine Learning with Scikit-Learn, Keras & Tensorflow (2nd ed.). O’Reilly Media.

Gründler, K., & Krieger, T. (2021). Using Machine Learning for measuring democracy: A practitioners guide and a new updated dataset for 186 countries from 1919 to 2019. European Journal of Political Economy, 70, 102047. DOI:

Jiang, W., He, G., Long, T., Ni, Y., Liu, H., Peng, Y., Lv, K., & Wang, G. (2018). Multilayer perceptron neural network for surface water extraction in landsat 8 OLI satellite images. Remote Sensing, 10(5). DOI:

Kang, I., Kim, N., Loh, W., & Bichelmeyer, B. (2021) A Machine-Learning Classification Tree Model of Perceived Organizational Performance in U.S. Federal Government Health Agencies. Sustainability, 13(18). DOI:

Lee, J., & Pak, T. (2022) Machine learning prediction of suicidal ideation, planning, and attempt among Korean adults: A population-based study. SSM - Population Health, 19. DOI:

Liu, Y., Esan, O. C., Pan, Z., & An, L. (2021). Machine learning for advanced energy materials. Energy and AI, 3, 100049. DOI:

Marek, J. (2021). The Public Perception of Police Corruption in Venezuela and its Effect on National Government. Revista Sul-Americana de Ciência Política, 1(3), 1–21. DOI:

Morabito, V. (2016). The Future of Digital Business Innovation. Springer International Publishing. DOI:

Müller, A. C., & Guido, S. (2017) Introduction to Machine Learning with Python: a guide for data scientists, O’Reilly Media.

Nascimento, F.M., Barone, D., & Castro, H. C. (2019) Social Activism Analysis: An Application of Machine Learning in the World Values Survey. Proceedings of the MLDM, v. 1, pp. 28-38.

Pecorari, N., & Cuesta, J. (2023). Citizen Participation and Political Trust in Latin America and the Caribbean: A Machine Learning Approach. Policy Research Wrking Papers, 10335. DOI:

Plotnikova, V., Dumas, M., & Milani, F. (2020). Adaptations of data mining methodologies: a systematic literature review. PeerJ Computer Science, 6, e267. DOI:

Power, T. J., & Jamison, G. D. (2005). Desconfiança política na América Latina. Opinião Pública, 11(1), 64–93. DOI:

Raschka, S. (2015). Python Machine Learning (1st ed.). Packt Publishing Ltd.

Resende, R. C., & Epitácio, S. D. S. F. (2014). Desenvolvimento econômico e satisfação com a democracia: uma análise da América Latina. Ciências Sociais Unisinos, 50(2). DOI:

Saarela, M., & Jauhiainen, S. (2021). Comparison of feature importance measures as explanations for classification models. SN Applied Sciences, 3(2), 272. DOI:

Saravia, A., & Marroquín, A. (2023). Political ideology mismatch as a determinant of the intention to migrate: evidence from Latin America. International Journal of Social Economics, 50(1), 97–110. DOI:

Silva, D. R. de M., & Mizuca, H. D. de. (2021). Índice de democracia local: estudos a partir da experiência de São Paulo (1st ed.). Instituto Atuação.

Sima, D., & Huang, F. (2023). Is democracy good for growth? — Development at political transition time matters. European Journal of Political Economy, 102355. DOI:

Speiser, J. L., Miller, M. E., Tooze, J., & Ip, E. (2019). A comparison of random forest variable selection methods for classification prediction modeling. Expert Systems with Applications, 134, 93–101. DOI:

Tan, P.-N., Steinbach, M., Karpatne, A., & Kumar, V. (2019). Introduction to Data Mining (2nd ed.). Pearson Prentice Hall.

Tsyganov, V. (2021). Supervised Machine Learning of Citizens and Political Stability. IFAC-PapersOnLine, 54(13), 611–616. DOI:

Valero-Carreras, D., Alcaraz, J., & Landete, M. (2023). Comparing two SVM models through different metrics based on the confusion matrix. Computers & Operations Research, 152, 106131. DOI:

Waqar, M., Dawood, H., Dawood, H., Majeed, N., Banjar, A., & Alharbey, R. (2021). An Efficient SMOTE-Based Deep Learning Model for Heart Attack Prediction. Scientific Programming, 2021, 1–12. DOI:

Witten, I. H., & Frank, E. (2005). Data Mining: Practical Machine Learning Tools and Techniques (2nd ed.). Elsevier Ltd.

Yida Tao, Shan Tang, Yepang Liu, Zhiwu Xu, & Shengchao Qin. (2021). Speeding Up Data Manipulation Tasks with Alternative Implementations: An Exploratory Study. ACM Transactions on Software Engineering and Methodology, 30(4), 1–28. DOI:




Como Citar

Rosa, D. M. de S., dos Santos, B. S., & Lima, R. H. P. (2023). Predicting satisfaction with democracy in Brazil considering data form an opinion survey . Revista Gestão Da Produção Operações E Sistemas, 18(00).