Groundwater is an essential resource for human consumption, agricultural irrigation, and husbandry development in arid and semi-arid areas. This study systematically evaluated and predicted groundwater suitability for drinking and irrigation in the agro-pastoral regions of Northern China by integrating water quality indices with six machine learning (ML) techniques: Random Forest (RF), Support Vector Machine (SVM), Artificial Neural Network (ANN), K-Nearest Neighbors (KNN), Long Short-Term Memory (LSTM), and Extreme Gradient Boosting (XGBoost). A total of 1040 samples were classified into four groundwater clusters using self-organizing maps. Hydrochemical analysis identified Na+K-ClSO4 and Na+K-HCO3 as dominant water types, influenced by silicate weathering, evaporation, and anthropogenic activities (industrialization or mining). Entropy-weighted water quality index (EWQI) analysis indicated that 44.91 %, 40.96 %, and 14.13 % of the samples were excellent to good, moderate, and poor to unsuitable for drinking, respectively. Irrigation water quality index (IWQI) results showed that 39.8 % of the samples were suitable for irrigation, whereas 60.2 % had moderate to severe restrictions caused by elevated salinity in groundwater, which affects soil quality and crop productivity. The predictive models were developed using EWQI and IWQI as dependent variables and physicochemical parameters as inputs. The predictive performance of ML models ranked ANN > SVM > LSTM > RF > XGBoost > KNN for EWQI, and XGBoost > RF > KNN > ANN > SVM > LSTM for IWQI. This study enhances the application of ML approaches in groundwater quality assessment and helps the national and local authorities make sustainable water management decisions in arid and semi-arid agricultural-pastoral regions.