The average longevity of a person is measured by life expectancy. The length of one's life is determined by several factors. In this study, we utilized GDP, rural population growth, urban population growth, services value, industry value, food production, permanent cropland, cereal production, agriculture, forestry, and fisheries value as predictors of life expectancy. We also examined different links that may influence life expectancies, such as the negative link between life expectancy and the rural population. We also observed how personality traits are linked to life expectancy and impact how our lives are spent. To evaluate the accurate regression model, we use eight different techniques. The result indicates that the Extreme Gradient Boosting Regressor has the highest accuracy and the least margin of error among all the models. It was 99 percent accurate. The other models like K-Neighbors, Random Forest, and Stacking Regressor were 94 percent accurate. Decision Tree has the lowest accuracy among all the models, at 79 percent. The Gradient Boosting Regressor comes in second with 96 percent accuracy. Multiple Linear Regression and Light Gradient Boosting Machine Regressor scored 88 percent and 87 percent, respectively. This study assists a country’s policymakers related to public health by enhancing the value of factors that are closely associated with life expectancy.