Indian Journal of Animal Research

  • Chief EditorK.M.L. Pathak

  • Print ISSN 0367-6722

  • Online ISSN 0976-0555

  • NAAS Rating 6.50

  • SJR 0.263

  • Impact Factor 0.5 (2023)

Frequency :
Monthly (January, February, March, April, May, June, July, August, September, October, November and December)
Indexing Services :
Science Citation Index Expanded, BIOSIS Preview, ISI Citation Index, Biological Abstracts, Scopus, AGRICOLA, Google Scholar, CrossRef, CAB Abstracting Journals, Chemical Abstracts, Indian Science Abstracts, EBSCO Indexing Services, Index Copernicus
Indian Journal of Animal Research, volume 57 issue 9 (september 2023) : 1251-1257

Body Weight Prediction using Recursive Partitioning and Regression Trees (RPART) Model in Indian Black Bengal Goat Breed: A Machine Learning Approach

Avijit Haldar1,*, Prasenjit Pal2, Sarbaswarup Ghosh3, Subhransu Pan4
1ICAR-Agricultural Technology Application Research Institute, Kolkata-700 097, West Bengal, India.
2College of Fisheries, Central Agricultural University, Lembucherra-799 210, West Tripura, India.
3Sasya Shyamala Krishi Vigyan Kendra, Ramakrishna Mission Vivekananda Educational and Research Institute, Sonarpur, South 24 Parganas-700 150, West Bengal, India.
4Department of Livestock Production Management, West Bengal University of Animal and Fishery Sciences, Kolkata-700 037, West Bengal, India.
Cite article:- Haldar Avijit, Pal Prasenjit, Ghosh Sarbaswarup, Pan Subhransu (2023). Body Weight Prediction using Recursive Partitioning and Regression Trees (RPART) Model in Indian Black Bengal Goat Breed: A Machine Learning Approach . Indian Journal of Animal Research. 57(9): 1251-1257. doi: 10.18805/IJAR.B-4894.
Background: Live body weight (BW) of livestock animals is truly mirror image of all activities of genetics, nutrition, production, reproduction and health status. Thus, the knowledge of calculating BW is of great importance to the producer and critical for goat farming and business. However, there is an unavailability of suitable scales, leading to inaccuracies in decision-making. The present work aimed to predict the live BW of Indian Black Bengal goat using certain morphometric data. 

Methods: The live BW and eight body measurement data from 1427 disease free, non-pregnant goats aged 25.87±10.47 months with 2.78±1.21 number of parity were collected. The data were first subjected to stepwise regression analysis to achieve the best-fitted model for BW prediction by comparing coefficient of determination (R2) and determining the combination of body dimensions that explained variation in the dependent variable. Further, Recursive Partitioning and Regression Trees (RPART) model, a machine learning tool was deployed to predict BW using certain body measurements.

Result: The results of stepwise regression model clearly indicated that heart girth (HG) and punch girth (PG) measurements influenced live BW mostly, but the predictive capabilities (Low R2) of this statistical model were low. The stepwise regression model could not satisfactorily predict BW due to the problem of multicollinearity. Out of eight independent variables, the most important variables emerged from RPART were only HG and PG based on the largest reduction in overall sums of squares error. RPART generated a decision tree with minimal expected error to precisely predict live BW. Hence, RPART model was found to provide better predictive result than stepwise regression model in accurately predicting BW from body measurement variables in Black Bengal goats.
Goat farming is one of the principal animal husbandry components all over the world. In Asia and Africa, goat farming has huge potential for economic upliftment for marginal and landless farmers (Devendra 2015). Small to medium scale goat farming has become an emerging opportunity for rural youths in Indian subcontinent. Not only in Asia and Africa, dairy goat farming has bright prospect in North, Central and South America and the Caribbean islands (Lu and Miller 2019).  

Body measurements of goats are imperative within the scope of reflecting the breed standards (Verma et al., 2016) and have significant relationship with animal’s live body weight (BW) for determining breed standards, selection criteria and the prices of the goats (Eyduran et al., 2017; Abd-Allah et al., 2019). There are large variations in BW and functionality among different goat breeds. BW of a goat is important for a number of reasons, related to breeding (selection), feeding and health care. BW has direct relationship with feed conversion ratio and maintenance efficiency in goat breeds (Kusminanto 2020). The prediction of BW and its relationships to other morphological measurements produces appreciable knowledge for breeding strategy with regard to meat production per animal (Yilmaz et al., 2013; Iqbal et al., 2013). BW is truly is mirror image of all activities of genetics, nutrition, production, reproduction and health status. Thus, the knowledge of calculating BW is of great importance to the producer and critical for management as well as economic point of view in goat rearing, management and business. However, this fundamental knowledge is often unavailable to those working in goat farming sector, due to unavailability of scales, leading to inaccuracies in decision-making.

Traditional statistical techniques have been utilized in determining BW in livestock. Some of the models aggregate observed morphometric data to make estimates of expected outcomes. Certain body morphometric traits have been utilized to formulate such equations using regression models for predicting BW dynamics in cattle (Siddiqui et al., 2015), sheep (Cam et al., 2010) and goats (Moaeen-ud-Din et al 2006; Adhianto et al., 2020; Sun et al., 2020). It is known that statistical models aim to identify relationships between variables, but the predictive capabilities (in terms of their accuracies) of these statistical models are low. These usual regression procedures cannot evaluate the multicollinearity between independent factors; hence it can lead to biased outcomes (Raja et al., 2012; Ruhil et al., 2013). Multiple linear regression model (MLR) looks at the linear relationship between the dependent and set of independent variables. Sometimes, this relationship may be nonlinear or complex in nature and as a consequence, the estimates of MLR may be biased. Besides, MLR may suffer from the problem of multicollinearity (strong correlation among independent variables) which often exists between independent variables (Iqbal et al., 2021). 

Recently, data mining and machine learning algorithms are becoming popular modelling and prediction tools among practitioners due to their ability to model complex relationships and high predictive accuracy. Artificial Neural Networks (ANNs) are a commonly used branch of Machine Learning (ML) methods that are used to correlate input parameters to corresponding output data. Application of ANNs in medical fieldis available in literatures (Hall 2009; Tasdemir et al., 2011; Litjens et al., 2017; Wang et al., 2021). Few studies have successfully applied these ML methods in livestock sciences (Nasirahmadi et al., 2017; Cominotte et al., 2020). Different deep learning (DL) models performance in the regression task like Convolutional Neural Networks (CNNs), recurrent attention models and recurrent attention models with CNNs have been explored and found that CNNs could achieve the highest performance in predicting BW of beef cattle (Gjergji et al., 2020) and Hereford cows (Ruchay et al. 2021). ML methods have been implemented in order to predict BW of Harnai sheep (Ali et al., 2015), Pakistani goat breed (Celik et al., 2018), Balochi sheep (Huma and Iqbal 2019) and Beetal goats (Eyduran et al., 2017; Iqbal et al., 2021). To the best of the current knowledge, no previous study has used these ML methods for predicting BW of highly prolific, excellent meat-type Black Bengal goats (Das et al., 2018) in Indian subcontinent. There is dearth of literature related to BW measurement formula in this unique goat breed reared in its home tract. Therefore, the present work aimed to determine the best-fitted regression model using certain morphometric data for prediction of live BW and investigate the applicability of machine learning to improve on the prediction of BW in Black Bengal goat raising program in Eastern part of India. Additionally, we would like to compare machine learning model with the statistical regression model for the predictive analysis of live BW. 
Study area
The study area included 45 villages in 4 districts (Nadia, North 24 Paraganas, Hooghly and Murshidabad) of West Bengal, a state of Eastern India and 23 villages in 3 districts (West Tripura, South Tripura and Dhalai) of Tripura, a state of North-East India. Two-stage stratified random sample survey (consisting of village as strata-1 and animal within village as strata-2) was conducted to collect certain morphometric data on Black Bengal goats.
The Black Bengal goat breed was the experimental animal in the present study. In the villages, the goats were generally reared in small numbers from 2 to 5 per household. The goats were allowed for free grazing during the day on natural pasture, tree lopping and scavenging on kitchen waste when available without any supplementation. A total of 1427 disease free, non- pregnant goats aged 25.87±10.47 months with 2.78±1.21 number of parity were selected randomly in the villages for collecting data on various linear traits.
Ethical approval
The experimental protocol and animal care were met in accordance with the National guidelines for care and use of Agricultural Animals in Agricultural Research and Teaching.
Data and variables
Data of the present study were obtained from the previous publication (Haldar et al., 2014). BW (kg) of 1427 goats was recorded using a spring balance. To predict BW of Black Bengal goats based on set of independent variables, eight body measurements: head rump length (HRL), head rump curve length (HRCL), body length (BL), heart girth (HG), paunch girth (PG), wither height (WH), croup height (CH) and chest height (CHH) were recorded. The length, height and circumference measurements (centimeters) were taken using a measuring tape. All measurements were recorded on an individual data sheet from the non- pregnant goats in the morning before the animals were released for grazing. Each individual goat was sampled once only.
Statistical analysis
Data sorting
The obtained data were edited firstly and the outliers and the illogical data were removed from the dataset. The microsoft excel and neuro solution (http://www. neuro software were used to normalize and standardize the data. Finally, data collected on 1397 goats were used.  As there was no evidence of location effect on data set reported earlier (Haldar et al., 2014), data recorded on 1397 goats in two locations, viz. West Bengal and Tripura were pooled together and subjected to statistical analysis.
Stepwise regression analysis
In order to predict BW of Black Bengal goat from the various body measurements taken at field level the stepwise regression procedure was applied to find the variables which are affecting the body weight using multiple stepwise regressions (PROC PHREG; SAS 9.3, 2012). BW was regressed on body measurements following least square by stepwise regression analysis to compare R² and determine the combination of body dimensions that explained variation in the dependent variable. The model used was the stepwise regression (SR) model:
Y= α + β1x1 + β2x2 +... + βixi….(1)
α = Intercept of the model. 
β = Coefficient of predictor variables.

SR enters predictor variables in a stepwise manner; it will also fit specified models or perform forward selection of variables. At each step in the stepping process, an attempt was made to enter significant variables into the model and stop when no more predictors can be justifiably entered or removed from our stepwise model, thereby leading to a “final model.”
Application of machine learning model
Data that were analyzed using regression models in the previous step were analyzed using a decision tree model known as Recursive Partitioning and Regression Trees (RPART) (Baldi and Brunak 2002). This machine learning tool created a decision tree through some algorithm that classified members of the population by splitting it into sub-populations based on several dichotomous independent variables for predictive modeling in machine learning (Alpaydin 2020). Decision Trees partitioned a data set into smaller subgroups and then fit a simple constant for each observation in the subgroup. The partitioning was achieved by successive binary partitions (recursive partitioning) based on the different predictors. The constant to predict was based on the average response values for all observations that fell in that subgroup. The total data set was divided into 70: 30 ratio for training and testing purpose indicating that out of 1397 observations 978 observations were used for training and rest 419 observations for testing.
Deciding on internal nodes/splits
The partitioning of variables was made in a top-down, greedy fashion that a partition was performed earlier in the tree that would not be changed based on later partitions. The model began with the entire data set, S and searched every distinct value of every input variable to find the predictor and split value that partitioned the data into different regions such that the overall sums of squares error were minimized.

Having found the best split, the data were partitioned into two resulting regions and the splitting process was repeated on each of the two regions. This process was continued until some stopping criterion was reached. What results was, typically, a very deep, complex tree that might produce good predictions on the training set, but was likely to over fit the data, leading to poor performance on unseen data.
Cost complexity criterion
There was often a balance to achieve in the depth and complexity of the tree for optimizing predictive performance on some unseen data. To find this balance, we typically grew a very large tree and then pruned it back to find an optimal subtree. We created the optimal subtree by using a cost complexity parameter (α) that penalized our objective function for the number of terminal nodes of the tree (T) as in Eq 1.
Minimize {SSE+α|T|}……(2)
For a given value of α, the smallest pruned tree had the lowest penalized error. 
Regression analysis
The result of stepwise regression analysis is presented in Table 1. The ANOVA table for stepwise regression and the coefficients from stepwise regression model were given in the Table 2 and 3, respectively.Various body measurements were considered to construct the regression equation. In the present study, regression equations could not satisfactorily predict BW in Black Bengal Goat as coefficient of determination (R2) in the regression models was very low.

Table 1: Biometrical relationship between body measurements and BW using stepwise regression.

Table 2: The results of analysis of variance (ANOVA) table using stepwise regression.

Table 3: Stepwise regression model with their respective coefficients.

The results clearly indicated that HG and PG influenced BW mostly, but with low degree of precision (as R2 was 0.443 and 0.458). However, Habib et al., (2019) reported that regression equation involving HG and BL could predict live BW accurately in Black Bengal Goat. Previously, certain body morphometric traits have been utilized to formulate regression equations using step wise regression method for predicting BW dynamics in other goat breeds (Moaeen-ud-Din et al 2006; Adhianto et al., 2020; Sun et al., 2020). Though stepwise regression model identified relationships between variables, the predictive capabilities (in terms of their accuracies) of this statistical model were low in the preset study. These usual regression procedures could not evaluate the multicollinearity between independent factors; hence it could lead to biased outcomes (Raja et al., 2012; Ruhil et al., 2013).  
Recursive partitioning and regression trees (RPART)
As the results of stepwise regression could not satisfactorily predict BW, RPART, a machine learning tool has been deployed here to predict BW of Black Bengal goat based on some independent body measurements. The machine learning tool was used for improving prediction of BW of Black Bengal goats to evaluate the performance and capabilities on how it could provide BW information for the stakeholders of goat farming.

Out of eight independent variables the most important variables emerged from RPART were only HG and PG based on the largest reduction in overall sums of squares error (SEE) as shown in Table 4. The complexity parameter is presented in Table 5.

Table 4: Variable importance of different body measurements from RPART.

Table 5: Complexity parameter (CP).

To illustrate the point of selecting a tree with 7 terminal nodes, we could force RPART to generate a full tree by using CP=0 (no penalty resulted in a fully grown tree). As the tree grewdeeper towards 7 terminal nodes, there was diminishing return in error reduction as shown in Fig 1. Thus, we could significantly prune our tree and still achieve minimal expected error (Mean Absolute Error- 2.60431219).

Fig 1: Pattern of error reduction under RPART.

Decision tree predicting goat BW using RPART model is presented in Fig  2. All observations went through this tree, were assessed at a particular node and proceeded to the left if the answer was “yes” or proceeded to the right if the answer was “no”. First, all observations that had HG less than 64 went to the left branch; all other observations wherein HG was more than 64 cm preceded to the right branch. Next, the branches were further partitioned by both HG and PG leading to terminal nodes which had predicted response value. The predicted BW under different measurements of HG and PG is shown in Table 6. For example, if PG was <63 cm and HG was<56 cm, BW of goat was13 kg and if PG was >63 cm and HG was<56 cm, BW of goat was 15 kg and so on.

Fig 2: Decision tree predicting goat body weight using RPART model.

Table 6: Predicted BW under different measurements of HG and PG.

Goat genetic resource is highly diverse in the world and body morphometrics are distinct from one breed to another (FAO 2007). Though ML methods have been used in order to predict BW of Harnai sheep (Ali et al., 2015), Pakistani goat breed (Celik et al., 2018), Balochi sheep (Huma and Iqbal 2019) and Beetal goats (Eyduran et al., 2017; Iqbal et al., 2021), the application of RPART machining learning tool for the prediction of BW using only two body measurements, i.e., HG and PG in Black Bengal goats is the first time information.
Many researchers formulated regression equations for predicting BW in different goat breeds. However, regression model might not be a suitable measure for accurately predicting BW due to the problem of multicollinearity which often existsted between independent variables. Thus, the present study aimed at predicting BW of Black Bengal goats by different body measurement variables using a machining learning tool known as RPART. The present study showed that RPART model hold promise for precisely predicting BW of Black Bengal goats. Hence, RPART model could be considered as the method of choice for BW calculation from body measurement variables in Black Bengal goats.
The authors gratefully acknowledge the financial supports of ICAR, New Delhi, India for providing National Fund for Basic, Strategic and Frontier Application Research in Agriculture (Grant no. NFBSRA/PCN/AP-06/2006-07). The authors wish to thank the farmers for their regular help and cooperation during the investigation in the field.

  1. Abd-Allah, S., Abd-El Rahman, H.H., Shoukry, M.M., Mohamed, M.I., Salman, F.M., Abedo, A.A. (2019). Some body measurements as a management tool for shami goats raised in subtropical areas in egypt. Bulletin of the National Research Centre. 43: 17.

  2. Adhianto, K., Harris, I., Nugroho, P., Putra, W.P.B. (2020). Prediction of body weight through body measurements in boerawa (Boer × Etawah crossbred) bucks at tanggamus regency of Indonesia. Bulgarian Journal of Agricultural Science. 26(6): 1273-1279.

  3. Ali, M., Eyduran, E., Tariq, M.M., Tirink, C., Abbas, F., Bajwa, M.A., Baloch, M.H., Nizamani, A.H., et al. (2015). Comparison of artificial neural network and decision tree algorithms used for predicting live weight at post weaning period from some biometrical characteristics in Harnai Sheep. Pakistan Journal of Zoology. 47: 1579-1585.

  4. Alpaydin, E. (2020). Introduction to Machine Learning (Fourth ed.). MIT. pp. xix, 1-3, 13-18. ISBN 978-0262043793.

  5. Baldi, P., Brunak, S. (2002). Bioinformatics: A Machine Learning Approach. Cambridge, MA: MIT Press.

  6. Cam, M.A., Olfaz, M., Soydan, E. (2010). Possibilities of using morphometrics characteristics as a tool for body weight production in Turkish hair goats (Kilkeci). Asian Journal of Animal and Veterinary Advances. 5: 52-59. 

  7. Celik, S., Eyduran, E., Tatliyer, A., Karadas, K., Kara, M.K. and Waheed, A. (2018). Comparing predictive performances of some nonlinear functions and multivariate adaptive regression splines (MARS) for describing the growth of Dera Dýn Panah (DDP) goat in Pakistan. Pakistan Journal of Zoology. 50: 1187-1190. 

  8. Cominotte, A., Fernandes, A.F.A., Dorea, J.R.R., Rosa, G.J.M., Ladeira, M.M., van Cleef, E.H.C.B., Pereira, G.L., et al. (2020). Automated computer vision system to predict body weight and average daily gain in beef cattle during growing and finishing phases. Livestock Science. 232: 103904. doi: 10.1016/j.livsci.2019.103904.

  9. Das, B.C., Bera, S., Pandit, S., Panda, R., Roy, M. (2018). Studies on growth parameters of black Bengal goats in coastal sundarban of West Bengal. International Journal of Fauna and Biological Studies. 5(6): 1-4.

  10. Devendra, C. (2015). Dynamics of goat meat production in extensive systems in Asia: Improvement of productivity and transformation of livelyhoods. Agrotechnol. 4: 131. doi: 10.4172/2168- 9881.1000131.

  11. Eyduran, E., Zaborski, D., Waheed, A., Celik, S., Karadas, K. and Grzesiak, W. (2017). Comparison of the predictive capabilities of several data mining algorithms and multiple linear regression in the prediction of body weight by means of body measurements in the indigenous beetal goat of Pakistan. Pakistan Journal of Zoology. 49: 257-265. 

  12. FAO. (2007). The State of the World’s Animal Genetic Resources for Food and Agriculture-in Brief, edited by Dafydd Pilling and Barbara Rischkowsky. Rome.

  13. Gjergji, M., Weber, V.D.M., Silva, L.O.C., Gomes, R.D.C., de Arajo, T.L.A.C., Pistori, H., Alvarez, M. (2020). Deep Learning Techniques for Beef Cattle Body Weight Prediction. International Joint Conference on Neural Networks (IJCNN), Glasgow, UK. pp. 1-8, doi: 10.1109/IJCNN48605.2020.9207624.

  14. Habib, M.A., Akhtar, A., Bhuiyan, A.K.F.H., Choudhury, M.P., Afroz, M.F. (2019). Biometrical relationship between body weight and body measurements of Black Bengal goat (BBG). Current Journal of Applied Science and Technology. 35(2): 1-7.

  15. Haldar, A., Pal, P., Majumdar, D., Biswas, C.K., Ghosh, S., Pan, S. (2014). Body linear traits for identifying prolific goats. Veterinary World. 7(12): 1103-1107.

  16. Hall, K.D. (2009). Predicting metabolic adaptation, body weight change and energy intake in humans. American Journal of Physiology, Endocrinology and Metabolism. 298(3): E449-E466.

  17. Huma, Z.E., Iqbal, F. (2019). Predicting the body weight of Balochi sheep using a machine learning approach. Turkish Journal of Veterinary and Animal Scence. 43: 500-506.

  18. Iqbal, F., Waheed, A., Zil-e-Huma, Faraz, A. (2021). Comparing the predictive ability of machine learning methods in predicting the live body weight of Beetal goats of Pakistan. Pakistan Journal of Zoology. 1-8. Doi: 10.17582/journal. pjz/20191003081007.

  19. Iqbal, M., Javed, K., Ahmad, N. (2013). Prediction of body weight through body measurements in Beetal goats. Pakistan Journal of Science. 65(4): 458-461.

  20. Kusminanto, R., Alawiansyah, A., Pramono, A., Sutarno, Cahyadi, M. (2020). Body Weight and Body Measurement Characteristics of Seven Goat Breeds in Indonesia. IOP Conference Series: Earth and Environmental Science. 478: 012039.

  21. Litjens, G., Kooi, T.,  Bejnordi, B.E., Setio, A.A.A., Ciompi, F., Ghafoorian, M., Van der Laak, J.A.W.M., Van Ginneken, B., Sánchez, C.I. (2017). A survey on deep learning in medical image analysis. Medical Image Analysis. 42: 60-88. 

  22. Lu, C.D., Miller, B.A. (2019). Current status, challenges and prospects for dairy goat production in the Americas. Asian-Australasian Journal of Animal Science. 32(8): 1244-1255. 

  23. Moaeen-ud-Din, M.N., Ahmad, N., Iqbal, A., Abdullah, M. (2006). Evaluation of different formulas for weight estimation in Beetal, Teddi and crossbred (Beetal × Teddi) goats. Journal of Animal and Plant Science. 16(3): 74-78.

  24. Nasirahmadi, A., Edwards, S.A., Sturm, B. (2017). Implementation of machine vision for detecting behaviour of cattle and pigs. Livestock Science. 202: 25-38.

  25. Raja, T.V., Ruhil, A.P., Gandhi, R.S. (2012). Comparison of connectionist and multiple regression approaches for prediction of body weight of goats. Neural Computing and Applications. 21: 119-124.

  26. Ruchay, A.N., Kolpakov, V.I., Dzhulamanov, K.M., Dorofeev, K.A. (2021). Predicting the Body Weight of Hereford Cows using Machine Learning. IOP Conference Series: Earth and Environmental Science. 624: 012056. doi: 10.1088/1755-1315/624/1/012056.

  27. Ruhil, A.P., Raja, T.V., Gandhi, R.S. (2013). Preliminary study on prediction of body weight morphometric of goats through ANN models. Journal of the Indian Society of Agricultural Statistics. 67: 51-58.

  28. SAS. 9.3. (2012). Foundation for Microsoft Windows. SAS Institute Inc., Cary, NC.

  29. Siddiqui, M.U., Lateef, M., Bashir, M.K., Bilal, M.Q., Muhammad, G., Mustafa, M.I., Rehman, S. (2015). Estimation of live weight using different body measurements in Sahiwal cattle. Pakistan Journal of Life and Social Sciences. 13: 12-15.

  30. Sun, M.A., Hossain, M.A., Islam, T., Rahman, M.M., Hossain, M.M., Hashem, M.A. (2020). Different body measurement and body weight prediction of Jamuna basin sheep in Bangladesh. SAARC Journal of Agriculture. 18(1): 183-196. 

  31. Tasdemir, S., Urkmez, A., Inal, S. (2011). Determination of body measurements on the holstein cows using digital image analysis and estimation of live weight with regression analysis. Computers and Electronics in Agriculture. 76(2): 189-197.

  32. Verma, S.K., Dahiya, S.P., Malik, Z.S., Patil, C.S., Patil, H.R. (2016). Biometrical characterization of Harnali sheep: A new synthetic strain. Indian Journal of Veterinary Research. 25: 16-21.

  33. Wang, Z., Shadpour, S., Chan, E., Rotondo, V., Wood, K.M., Tulpan, D. (2021). Applications of machine learning for livestock body weight prediction from digital images. Journal of Animal Science. 99(2): 1-15.

  34. Yilmaz, O., Cemal, I., Karaca, O. (2013). Estimation of mature live weight using some body measurements in Karya sheep. Tropical Animal Health and Production. 45: 397-403.

Editorial Board

View all (0)