The main objective of the present study is to evaluate groundwater quality for irrigation purposes in the central-western part of Haryana state (India). For this, 272 groundwater samples were collected during the pre- and post-monsoon periods in 2022. Several indices, including SAR, PI, Na%, KR, magnesium adsorption ratio (MAR), and IWQI were derived. The results of SAR, Na%, and KR values indicate that the groundwater is generally suitable for irrigation. On the other hand, PI and MAR exceeded the established limits, primarily showing issues related to salinity and magnesium content in the groundwater. Furthermore, according to the IWQI classification, 47.06 and 25% of the total collected samples fell under the ‘Severe Restriction for irrigation’ category during the pre-monsoon and post-monsoon periods, respectively. Spatial variation maps indicate that water quality in the western portion of the study area is unsuitable for irrigation during both periods. Three ML algorithms, namely RF, SVM, and XGBoost were integrated and validated to predict the IWQI. The results revealed that the XGBoost with random search achieves the best prediction performances. The approaches established in this study have been confirmed to be cost-effective and feasible for groundwater quality, using hydrochemical parameters as input variables, and highly beneficial for water resource planning and management.