Machine learning-based prediction of pigeon pea area and production in relation to weather parameters in Solapur district, Maharashtra
Abstract
Pigeon pea (Cajanus cajan L.) is an important pulse crop in India and its area and production are influenced by prevailing weather conditions, particularly in semi-arid and rainfed regions. The present study was undertaken to identify weather-based prediction models for area and production of pigeon pea in Solapur district of Maharashtra using machine learning algorithms. Secondary time series data on pigeon pea area and production along with annual weather parameters, namely maximum temperature, minimum temperature, rainfall, relative humidity I relative humidity II, wind speed, evaporation and bright sunshine hours were collected for the period 1968–69 to 2022–23. Descriptive statistics, time series trend analysis and Pearson correlation analysis were employed to examine the variability, trends and association between weather parameters and pigeon pea area and production. Machine learning algorithms including Linear Regression, Ridge Regression, Least Absolute Shrinkage and Selection Operator Regression, Elastic Net Regression, Artificial Neural Network, K-Nearest Neighbour, Decision Tree, Random Forest, Support Vector Regression and Gradient Boosting were evaluated using an 80:20 training-testing data split. Model performance was assessed using the coefficient of determination (R2) and Root Mean Square Error (RMSE). The time series analysis indicated a decreasing trend in pigeon pea area, whereas production showed a slight increasing trend with considerable year-to-year variability. Correlation analysis revealed that rainfall had a positive association with pigeon pea production, while maximum temperature showed a negative association with pigeon pea cultivation. Wind speed, rainfall and bright sunshine hours were positively associated with pigeon pea area. Among the evaluated models, Gradient Boosting showed the highest R2 for pigeon pea area (R2 = 0.99) with RMSE of 100.98, while Linear Regression performed best for pigeon pea production (R2 = 0.83) with RMSE of 48.13. Validation using training and testing datasets showed good agreement between observed and predicted values. Five-year forecasting for 2023–2027 indicated a gradual decline in both pigeon pea area and production during the forecast period. The study demonstrates the usefulness of weather-based machine learning models for forecasting pigeon pea area and production and provides information that can support crop planning, resource allocation and weather-based agricultural decision-making in Solapur district.
Full Text
Tables and figures are in the full-text PDF.
Introduction
Pigeon pea (Cajanus cajan L.) is an important kharif pulse crop cultivated widely in India, particularly in semi-arid and rainfed regions. It is well adapted to relatively dry conditions and can be grown on marginal soils. Pigeon pea is commonly known as Arhar in Hindi and Tur in Marathi and belongs to the family Fabaceae. Its seeds contain about 20-22 per cent protein and provide important nutrients such as carbohydrates, minerals and vitamins, making it an important component of the human diet. In addition to its nutritional value, pigeon pea contributes to soil fertility through biological nitrogen fixation and supports sustainable agricultural production. Maharashtra is one of the major pigeon pea producing states in India, along with Madhya Pradesh, Karnataka and Telangana. As the crop is predominantly cultivated under rainfed conditions, its growth and production are closely influenced by seasonal weather variability. Solapur district of Maharashtra has a semi-arid climate characterized by low and erratic rainfall, high temperatures and frequent drought conditions. Pigeon pea is an important pulse crop cultivated in the district along with chickpea, green gram and black gram. Since its cultivation largely depends on rainfall, variations in the amount and distribution of rainfall may result in considerable fluctuations in crop area and production. Although pigeon pea has comparatively good drought tolerance, moisture stress and high temperature during critical growth stages, particularly flowering and pod filling, can adversely affect crop growth and yield. Consequently, variations in prevailing weather conditions may lead to year-to-year fluctuations in pigeon pea area, production and productivity.
Weather parameters such as temperature, rainfall, relative humidity, wind speed, evaporation and bright sunshine hours have an important influence on crop growth and development. Rainfall determines the availability of soil moisture, while temperature influences physiological processes and different stages of crop development. Relative humidity, wind speed, evaporation and bright sunshine hours also affect the crop microclimate and water requirement. Weather-based crop models are therefore used as scientific tools to quantify the relationship between weather variables and crop performance and to provide useful information for agricultural planning and decision-making under variable climatic conditions. Kumar and Gautam (2014) [1] . reported that weather parameters play an important role in crop growth and productivity, whereas Singh et al., (2016) [2] . reported that variations in weather conditions can influence crop area, productivity and total production of major crops. Traditional statistical techniques such as Linear Regression and Multiple Regression are commonly used for crop prediction because of their simple structure and ease of interpretation. However, these approaches may have limitations in capturing complex and nonlinear relationships between weather parameters and crop performance (Challinor et al., 2009) [3] . With the increasing availability of longterm agricultural and weather datasets, machine learning techniques have gained importance in crop prediction because of their ability to identify complex patterns and relationships within datasets. Various machine learning algorithms, including Random Forest, Artificial Neural Network, Support Vector Regression, Decision Tree, K-Nearest Neighbour and Gradient Boosting, can be employed to develop weather-based prediction models. These approaches can be used to estimate crop area and production based on historical agricultural and weather observations. In rainfed and semi-arid regions such as Solapur, the development of weather-based prediction models for pigeon pea area and production can provide valuable information for agricultural planning and resource management. Forecast information on expected crop area and production can assist farmers and planners in crop planning, input management, storage and marketing. Therefore, the present study was undertaken to examine the relationship between pigeon pea area and production and weather parameters and to develop and validate suitable machine learning models for predicting pigeon pea area and production in Solapur district of Maharashtra.
Materials and methods
Data collection
Secondary time series data on pigeon pea area and production for the period from 1968-69 to 2022-23, covering 55 years, were collected from the Directorate of Economics and Statistics, ICRISAT districtlevel data and official publications of the Government of Maharashtra.
The data were obtained from the (http://data.icrisat.org/dld/src/crops and https://data.desagri.gov.in/website/crops-apy-report-web).
Weather data were collected from the India Meteorological Department, Pune, Research Station, State Department of Agriculture and Department of Agricultural Meteorology. The weather parameters considered in the study included maximum temperature (°C), minimum temperature (°C), rainfall (mm), relative humidity I (%), relative humidity II (%), wind speed (km h -1 ), evaporation (mm) and bright sunshine hours (h).
Software used
The entire statistical analysis and machine learning modelling were carried out using Python software. It is an open-source, high-level programming language extensively used for data analysis, statistical computing, machine learning and predictive modelling. It provides a flexible and efficient environment for handling large datasets, applying machine learning algorithms, evaluating their performance and generating graphical outputs. Python is freely available and can be downloaded from the official Python Software Foundation website. Data pre-processing is an essential step that prepares the dataset before model development. Pre-processing improves model performance and ensures reliable prediction results. Pre-processing techniques included data cleaning, Missing value analysis, Feature selection, Feature scaling was used. The dataset was divided into training and testing subsets using 80:20 ratio which is commonly used in machine learning studies for model training and testing.
Statistical analysis and modelling approach
Descriptive statistics were computed to summarize the basic characteristics of the dataset. These measures provided information on the central tendency, variability and distribution of the crop and weather variables over the study period (1968-69 to 2022-23). The descriptive statistics included Mean, Median, Standard deviation, Minimum and Maximum values. The mean represents the average value of a variable over the study period and provides an estimate of its central tendency. The standard deviation measures the dispersion of observations around the mean, indicating the degree of variability present in the data. The minimum and maximum values describe the range of observations, while the quartiles summarize the distribution of the dataset and help identify the spread of the data.
Correlation analysis: Correlation analysis was performed to examine the relationship between weather variables and the response variables (crop area and production). It measures the strength and direction of the linear association between two variables. The Pearson correlation coefficient (r) was used in this study. The value of the correlation coefficient ranges from -1 to +1. The Pearson correlation coefficient is calculated as:
Where, 𝑋 𝑖 = Observed value of the independent variable 𝑌 𝑖 = Observed value of the dependent variable X= Mean of the independent variable
Ȳ= Mean of the dependent variable
The following machine learning algorithms were used
Gradient Boosting Regression
Each model was trained using the training dataset and evaluated using the testing dataset.
1. Linear Regression: Linear Regression was applied to examine the relationship between area, production and weather parameters. It estimates the effect of independent variables on the dependent variable assuming a straight-line relationship.
Ŷᵢ = 𝜷₀ + 𝜷₁𝑿ᵢ
𝑌 𝑖 = dependent variable (area/production) 𝑋 𝑖 = independent (predictor) variable (Tmax, Tmin, Rainfall, RHI, RHII, BSS, WS, ET)
𝛽 0 = intercept (value of 𝑌 when 𝑋 = 0) 𝛽 1 = slope coefficient (change in 𝑌for a one-unit change in 𝑋)
Ridge Regression:
Ridge regression is a regularized version of linear regression that adds a penalty term to shrink coefficient values. This helps to reduce overfitting and improves prediction accuracy, especially when independent variables are highly correlated.
𝑦= actual value
ŷ= predicted value from the model Goodness of fit: Model performance was assessed using the coefficient of determination (R (Singh et al., 2016) [2] ) and Root Mean Square Error (RMSE) (Elavarasan et al., 2018) [4] .
Coefficient of determination (R (Singh et al., 2016) [2] ): R (Singh et al., 2016) [2] gives overall variation explained by the model due to independent variables. It represents the proportion of total variance in dependent variable that is explained by independent variables. The value of R (Singh et al., 2016) [2] ranges from 0 to 1. A higher R (Singh et al., 2016) [2] indicates better model performance. Model performance was evaluated using the coefficient of determination (R (Singh et al., 2016) [2] ), root mean square error (RMSE). The best-performing model was selected based on these evaluation metrics and forecasted the area and production of Pigeon pea for next five years.
Results and discussion
Descriptive statistical analysis
The results of descriptive statistics analysis are presented in Table 1. The results of descriptive statistics for area and production of pigeon pea are presented in Table 1. The average cultivated area showed greater variability as indicated by its higher S.D. compared to production. The cultivated area varied from 53 to 772 hundred hectares, whereas production ranged from 7 to 340 hundred tonnes. These results indicated the noticeable fluctuations in pigeon pea area and production from year to year. The skewness values were positive for both area and production of pigeon pea showed that a few years recorded higher values than the average, particularly for production. The kurtosis values of area under pigeon pea indicated a flatter distribution, while the production of pigeon pea kurtosis value of 0.83 indicated a slightly more peaked distribution with some extreme production values. Table 2. showed that the mean maximum and minimum temperatures were 34.05 °C and 20.02 °C, respectively, with low variation. The standard deviations were 0.56 °C and 0.47 °C respectively, indicated that both maximum and minimum temperature remained relatively stable during the study period. Mean morning and evening relative humidity were 71.39% and 40.40%, respectively. The mean wind speed was 7.36 km/hr, positive skewness (1.72) indicated that a few years experienced relatively higher wind speed than the average. Annual rainfall averaged 712.17 mm and showed considerable variation (270.30-1292.40 Mean evaporation was mm, while bright sunshine hours averaged 7.47 hours. Overall, rainfall showed the highest variability, whereas temperature and evaporation remained relatively stable during the study period.
Correlation analysis for area and production of pigeon pea with weather parameters
From Fig. 1, the correlation analysis results revealed that the cultivated area was negatively correlated with maximum temperature (r = -0.63**), indicated that an increase in maximum temperature was associated with a reduction in the area under pigeon pea cultivation. Minimum temperature (r = -0.29*) and RHII (r = -0.10) showed weak negative relationship with crop area. The wind speed (WS) (r = 0.41**) had the positive significant correlation with the cultivated area, followed by rainfall (RF) (r = 0.29*).
Figure 1. Correlation heatmap for area under and weather parameters
These positive correlations indicated that favourable wind conditions, adequate rainfall and more sunshine hours were associated with an increase in the area under pigeon pea cultivation. Bishnoi et al., (1994) [5] . reported that weather parameters influenced biomass production in pigeon pea, indicating that weather conditions play an important role in pigeon pea performance. The morning relative humidity (RHI) (r = 0.04) and evaporation (EVP) (r = -0.04) showed non-significant correlation with the area of pigeon pea in Solapur district. Fig. 2 showed and revealed the results of correlation between pigeon pea production with weather parameters. that pigeon pea production was positive significantly correlated with rainfall (r = 0.37**), indicated that higher rainfall was associated with increased production. RHI (0.28*) and RHII (r = 0.11) showed positive non-significant correlation with production of pigeon pea. Evaporation had highly negative significant correlation (r = -0.43**) with production of pigeon pea, suggested that increased evaporation reduced crop production. Maximum temperature (r = -0.31*) had a significant negative correlation, indicated that higher maximum temperature was associated with minimum pigeon pea production. Wind speed (r = -0.04) and bright sunshine hours (r = -0.01) showed nonsignificant correlation with production, while minimum temperature (r = 0.02) had a negligible or non-significant positive correlation with production of pigeon pea. Overall rainfall was positively correlated with both pigeon pea area and production, while higher maximum temperature adversely affected both the cultivated area and production. Patel et al., (2026) [6] . also reported that adequate rainfall promoted pigeon pea growth and yield, whereas elevated temperatures adversely affected crop performance, particularly during the flowering and pod development stages. [2] values and higher RMSE values, indicated comparatively lower prediction accuracy. Based on the evaluation metrics, Linear regression achieved the highest prediction accuracy among the evaluated models.
Validation and forecasting of pigeon pea area by best fit model
The Gradient boosting model was applied using a random train-test split. Since the model used information from previous years (lag features), the first three years of data could not be included because no data from previous years were available to generate the lag features.
Conclusion
This study evaluated the predictive models of pigeon pea area and production. Pigeon pea area in Solapur district showed a decreasing trend over the years, whereas production showed a slight increasing trend with considerable year-to-year variability. Weather parameters such as rainfall and wind speed showed positive relationships with pigeon pea area, while maximum temperature showed a negative relationship with both area and production. Rainfall showed a positive relationship with production, whereas evaporation showed a negative relationship with production. Among all machine learning algorithms, the Gradient Boosting model performed best for pigeon pea area prediction, recording the highest R² (0.99) and lowest RMSE (100.98).
For production prediction, Linear Regression performed best, with the highest R² (0.83) and lowest RMSE (48.13). Forecast results indicated a gradual decline in pigeon pea area from 255.62 to 239.40 hundred hectares and production from 295.16 to 268.53 hundred tonnes during 2023-2027. Overall, the developed weather-based models provided useful predictions of pigeon pea area and production and can support agricultural planning, resource allocation and weather-based decisionmaking in Solapur district.
Acknowledgement
AcknowledgementsThe Department of Agricultural Meteorology, College of Agriculture, Pune and Department of Agricultural Economics and Statistics, College of Agriculture, Pune, Mahatma Phule Krishi Vidyapeeth, Rahuri provided research facilities to perform this experiment and statistical analysis, so I am thankful to the departments.
References
- Kumar R, Gautam HR. Climate change and its impact on agricultural productivity in India. J of Clim. & Weather Forecasting. 2014;2(1):1-3.
- Singh KK, Kalra N. Simulating impact of climatic variability and extreme climatic events on crop production. Mausam. 2016;67(1):113-130.
- Challinor AJ, Ewert F, Arnold S, Simelton E, Fraser E. Crops and climate change: progress, trends, and challenges in simulating impacts and informing adaptation. J of exper. Bot. 2009;60(10):2775-2789.
- Elvarasan D, Vincent DR, Sharma V, Zomaya AY, Srinivasan K. Forecasting yield by integrating agrarian factors and machine learning models: A survey. Computers and Electr. in Agril. 2018;155:257-282.
- Bishnoi OP, Niwas R, Taneja KD, Rao VU. Effect of weather parameters on biomass production in pigeon pea. Ann. of Arid Zone. 1994;33(2):117-119.
- Patel J. Climate change impact on pigeon pea (Cajanus cajan) yield in Maharashtra and Karnataka: A panel regression approach. J of Agromet. 2026;28(1):92-95.
- Klompenburg V, Kassahun A, Catal C. Crop yield prediction using machine learning: A systematic literature review. Computers and Electr. in Agril. 2020;177:105709.
How this paper connects to the literature. Drag to explore, click any node to open that paper.
