This study focused on predicting rainfall in four arid climatic zones in South Africa using four machine learning models. Prior to this, numerical models were used for weather forecasts in South Africa. Therefore, this study explores the use of machine learning models for rainfall prediction. The models used include linear regression, random forest, support vector machine, and ridge and lasso regression. The arid climatic zones were divided into four regions using the Koppen-Geiger climate classification system, with three locations selected for each zone. Atmospheric datasets from the South African Weather Service (1991–2023) and NASA (1983–2023) were utilized. These datasets were trained from 1983 to 2014 and tested from 2015 to 2023 using the four models. The monthly rainfall predictions obtained after training and testing were compared with actual data to validate the models' accuracy. Evaluation metrics such as mean absolute error, mean square error, root mean square error, correlation coefficient, and coefficient of determination were used to assess each model's performance. Support vector machine and random forest were the most accurate models across nearly all climatic zones. Linear regression, as well as ridge and lasso regression, also performed well in various regions. The study further indicated that atmospheric parameters such as dew point, cloud cover, and water vapor are essential at similar time lags for improved predictive performance.