Air pollution and climate change are two complementary forces that directly or indirectly affect the environment's physical, chemical, and biological processes. The air quality index is a parameter defined to cope with this effect of air pollution. This study delves deeper into predicting this AQI parameter using multiple machine learning-based models. The AQI pollutants considered for this study are particulate matter (PM10, PM2.5), SO2, and NO2. It also tries to develop a comparative analysis of two different machine learning (ML) models viz. a viz. XGBoost and Lasso regression. An ever-changing emission concentration of pollutants is displayed by this study conducted in the urban city of Gorakhpur Uttar Pradesh, India. The validation of prediction accuracies of models was done over several statistical metrics. The value of the R2 metric for XGBoost (0.9985) is comparatively more than the R2 value for Lasso regression (0.9218) indicating lesser variance and higher accuracy of XGBoost in predicting AQI. Various statistical measures are taken into consideration in this study, including mean absolute error (MAE), mean square error (MSE), root mean square error (RMSE), T-test and p-values, and confidence intervals (CI). An increased degree of model accuracy is suggested as XGBoost's MAE, MSE, and RMSE values are significantly lower than Lasso's. Statistically significant performance differences between the XGBoost and Lasso regression models are demonstrated by T-statistics and p-values for MAE, MSE, RMSE, and R2.