Groundnut, being a widely consumed oily seed with significant health benefits and appealing sensory profiles, is extensively cultivated in tropical regions worldwide. However, the yield is substantially impacted by the changing climate. Therefore, predicting stressed groundnut yield based on climatic factors is desirable. This research focuses on predicting groundnut yield based on several combinations of climatic factors using artificial neural networks and three training algorithms. The Levenberg–Marquardt, Bayesian Regularization, and Scaled Conjugate Gradient algorithms were evaluated for their performance using climatic factors such as minimum temperature, maximum temperature, and rainfall in different regions of Sri Lanka, considering the seasonal variations in groundnut yield. A three-layer neural network was employed, comprising a hidden layer. The hidden layer consisted of 10 neurons, and the log sigmoid functions were used as the activation function. The performance of these configurations was evaluated based on the mean squared error and Pearson correlation. Notable improvements were observed when using the Levenberg–Marquardt algorithm as the training algorithm and applying the natural logarithm transformation to the yield values. These improvements were evident through the higher Pearson correlation values for training (0.84), validation (1.00) and testing (1.00), and a lower mean squared error (2.2859 × 10−21) value. Due to the limited data, K-Fold cross-validation was utilized for optimization, with a K value of 5 utilized for the process. The application of the natural logarithm transformation to the yield values resulted in a lower mean squared error (0.3724) value. The results revealed that the Levenberg–Marquardt training algorithm performs better in capturing the relationships between the climatic factors and groundnut yield. This research provides valuable insights into the utilization of climatic factors for predicting groundnut yield, highlighting the effectiveness of the training algorithms and emphasizing the importance of carefully selecting and expanding the climatic factors in the modeling equation.