The advancement of technology has led humanity into the era of the information society, where information drives progress and knowledge is the most valuable resource. This era involves vast amounts of data, from which stored knowledge should be effectively extracted for use. In this context, machine learning is a growing trend used to address various challenges across different fields of human activity. This paper proposes an ensemble model that leverages multiple machine learning algorithms to determine the key factors for successful foreign direct investment, which simultaneously enables the prediction of this process using data from the World Bank, covering 60 countries. This innovative model, which adds to scientific and research knowledge, employs two sets of methods—binary regression and feature selection—combined in a stacking ensemble using a classification algorithm as the combiner to enable asymmetric optimization. The proposed predictive ensemble model has been tested in a case study using a dataset compiled from World Bank data across countries worldwide. The model demonstrates better performance than each of the individual algorithms integrated into it, which are considered state-of-the-art in these methodologies. Additionally, the findings highlight three key factors for foreign direct investment from the dataset, leading to the development of an optimized prediction formula.