Learning from Similar Cases: k-Nearest Neighbors and Conflict Forecasting in International Relations

Gidi Brandes

May 17, 2026

The increasing availability of large-scale data and computational tools contributes to the emergence of computational political science, broadly understood as the use of computer-assisted mathematical and statistical models to analyse complex political systems (RezaeeDaryakenari, 2025). Within this broader shift, forecasting recently became a central object of study, particularly in security studies, where scholars seek to anticipate rare but high-impact events such as armed conflict. Despite decades of research, traditional statistical models have often struggled to generate reliable predictions, in part due to their difficulty capturing nonlinear and context-dependent relationships (Beck et al., 2000; Ward et al., 2010). These limitations have contributed to a growing emphasis on predictive performance and out-of-sample validation in recent work (Mullainathan & Spiess, 2017, pp. 88–89).

Recent work demonstrates that predictive models can be successfully extended across diverse political systems using large cross-national datasets (Kennedy et al., 2017). At the same time, advances in machine learning have improved predictive accuracy and addressed challenges related to high-dimensional data and overfitting (Muchlinski et al., 2016, pp. 94–95). Within this expanding toolkit, the k-nearest neighbors (kNN) algorithm represents a simple, non-parametric approach that classifies observations based on similarity to historical cases (Cover & Hart, 1967). In applied settings such as political sentiment analysis, kNN has been used to detect patterns in complex data, with some versions improving accuracy by focusing more on the most similar cases (Palgunaa et al., 2024, pp. 233–234, 237).

Despite the growing adoption of machine learning, kNN has received relatively limited attention in IR compared to more complex approaches. This relative neglect is notable, as its similarity-based logic aligns with analogical reasoning commonly used in interpreting international events. At the same time, its simplicity raises important questions about its suitability for forecasting rare and complex political outcomes.

This paper therefore asks: Under what conditions can k-nearest neighbors contribute to forecasting and analyzing conflict and security dynamics in International Relations? To address this question, the paper proceeds in three steps. First, it situates kNN within the broader literature on computational political science. Second, it outlines the methodological properties of kNN and compares them to existing forecasting approaches. Third, it explores how kNN can be applied to selected problems in IR, including conflict prediction, event classification, and security risk assessment. In doing so, the paper aims to clarify the role of case-based methods within the evolving methodological landscape of political science.

References

Beck, N., King, G., & Zeng, L. (2000). Improving quantitative studies of international conflict: A conjecture. American Political Science Review, 94(1), 21–35.

Cover, T., & Hart, P. (1967). Nearest neighbor pattern classification. IEEE Transactions on Information Theory, 13(1), 21–27.

Kennedy, R., Wojcik, S., & Lazer, D. (2017). Improving election prediction internationally. Science, 355(6324), 515–520. https://doi.org/10.1126/science.aal2887

Muchlinski, D., Siroky, D., He, J., & Kocher, M. (2016). Comparing random forest with logistic regression for predicting class-imbalanced civil war onset data. Political Analysis, 24(1), 87–103. https://doi.org/10.1093/pan/mpv024

Mullainathan, S., & Spiess, J. (2017). Machine learning: An applied econometric approach. Journal of Economic Perspectives, 31(2), 87–106. https://doi.org/10.1257/jep.31.2.87

Palgunaa, I. M. S. A., Sanjaya, E. N. A., Widiartha, I. M., & Raharja, M. A. (2024). Twitter sentiment analysis regarding the influence of political figures using the distance-weighted k-nearest neighbor method. Journal of Informatics Research, 5(2), 233–238.

RezaeeDaryakenari, B. (2025). Computational methods in international relations research: The evolution and prospects.

Ward, M. D., Greenhill, B. D., & Bakke, K. M. (2010). The perils of policy by p-value: Predicting civil conflicts. Journal of Peace Research, 47(4), 363–375. https://doi.org/10.1177/0022343309356491

Yaman, S., Atalan, Y., & Gill, J. (2024). Bridging prediction and theory: Introducing the Bayesian partially-protected lasso. Electoral Studies, 87, 102730.