Milk Yield Prediction Using Animal and Production Features: Optimal Combinations and Machine Learning Approaches

Authors

DOI:

https://doi.org/10.24925/turjaf.v14i6.1476-1482.8393

Keywords:

Süt verimi, Laktasyon özellikleri, Simmental, Random Forest, Sürü yönetimi

Abstract

This study investigated the factors influencing milk yield in dairy cattle, the determination of optimal combinations, and the predictive performance of machine learning (ML) models. A total of 830 records collected in 2024 from a private dairy farm in Niğde, Turkey, were analyzed using breed, physiological status code, lactation number, age and days in milk as predictors. Statistical analyses confirmed that both breed and status code significantly affected milk yield (p < 0.05). Regression analysis indicated a positive effect of lactation number (β = 17.65, p < 0.001) and a negative effect of age (β = –0.80, p < 0.001). The highest yield (40.07 L/day) was recorded in Holstein Friesian cows with Cyclic status in the 3rd lactation. Six ML algorithms were compared using 5‑fold cross‑validation under two modelling scenarios designed to address multicollinearity between age and lactation number. Among the tested algorithms, Random Forest (R² ≈ 0.88, RMSE ≈ 5.2 L) and Gradient Boosting (R² ≈ 0.88, RMSE ≈ 5.2 L) provided markedly better predictive accuracy than linear regression models. SHAP (SHapley Additive exPlanations) analysis enhanced model interpretability and identified days in milk, physiological status and lactation number as the most influential predictors, followed by age and breed. These findings highlight the importance of integrating physiological and genetic factors in herd management and demonstrate the potential of ensemble ML techniques as reliable decision-support tools for optimizing milk yield in dairy farming.

References

Atashi, H., Zamiri, M. J., & Dadpasand, M. (2020). Association between dry period length and lactation performance, lactation curve, calf birth weight, and dystocia in Holstein dairy cows in Iran. Journal of Dairy Science, 103(1), 915–924.

Breiman, L. (2001). Random forests. Machine Learning, 45(1), 5–32.

Çanga, D., & Boğa, M. (2020). Determination of the effect of some properties on egg yield with regression analysis, Bagging MARS and R application. Turkish Journal of Agriculture- Food Science and Technology, 8(8), 1705–1712.

Çelik, S., Eyduran, E., Karadaş, K., & Tariq, M. M. (2017). Comparison of predictive performance of data mining algorithms in predicting body weight in Mengali rams. Brazilian Journal of Animal Science, 46(11), 863–872.

Çelik, S., & Yılmaz, O. (2018). Prediction of body weight of Turkish Tazi dogs using CART and MARS. Pakistan Journal of Zoology, 50(2), 575–583.

Çelik, S. (2019). Comparing predictive performances of tree-based data mining algorithms and MARS in goats. Pakistan Journal of Zoology, 51(4), 1447–1456.

Eyduran, E., Akin, M., & Eyduran, S. P. (2019). Application of Multivariate Adaptive Regression Splines through R Software. Nobel Academic Publishing.

Eyduran, E., Zaborski, D., Waheed, A., Çelik, S., Karadaş, K., Grzesiak, W. (2017). Comparison of predictive capabilities of data mining algorithms and MLR in goats. Pakistan Journal of Zoology, 49(1), 257–265.

FAO (2024). FAOSTAT. Food and Agriculture Organization of the United Nations. http://www.fao.org/faostat/

Friedman, J. (1991). Multivariate adaptive regression splines. Annals of Statistics, 19(1), 1–67.

Gianola, D., Okut, H., Weigel, K. A., & Rosa, G. J. (2011). Predicting complex traits with Bayesian neural networks. BMC Genetics, 12, 87.

Grzesiak, W., & Zaborski, D. (2012). Data mining in animal breeding. In Data Mining Applications in Engineering & Medicine, InTechOpen, pp. 303–324.

Grzesiak, W., Zaborski, D., Sablik, P., et al. (2018). Detection of cows with insemination problems using ML models. Computers and Electronics in Agriculture, 153, 228–233.

Hempstalk, K., McParland, S., & Berry, D. P. (2015). ML algorithms for prediction of conception success. Journal of Dairy Science, 98(8), 5262–5273.

Macciotta, N. P. P., Dimauro, C., Rassu, S. P. G., Steri, R., & Pulina, G. (2011). Mathematical description of lactation curves. Italian Journal of Animal Science, 10(4), e51.

Nguyen, Q. T., Fouchereau, R., Frénod, E., & Gérard, C. (2020). Comparison of forecast models of dairy cow production. Computers and Electronics in Agriculture, 170, 105258.

Olfaz, M., Tirink, C., & Onder, H. (2019). Use of CART and CHAID algorithms in sheep breeding. Kafkas Univ Vet Fak Derg, 25(1), 105–110.

Ray, D. E., Halbach, T. J., & Armstrong, D. V. (2019). Season and lactation number effects on milk production. Journal of Dairy Science, 102(9), 8181–8189.

Şahin, A., & Yılmaz, A. (2018). Comparison of milk yield & fertility of Holstein cows in Turkey vs imported. Italian Journal of Animal Science, 17(4), 884–891.

Shahinfar, S., Page, D., Guenther, J., et al. (2014). Prediction of insemination outcomes with ML. Journal of Dairy Science, 97(2), 731–742.

Smola, A. J., & Schölkopf, B. (2004). A tutorial on support vector regression. Statistics and Computing, 14(3), 199–222.

Vijayakumar, M., Park, J. H., Ki, K. S., et al. (2017). Effect of lactation, parity, milking frequency in Korean Holsteins. Asian-Australasian Journal of Animal Sciences, 30(8), 1093–1098.

Walsh, S. W., Williams, E. J., & Evans, A. C. O. (2011). Causes of poor fertility in high-yielding dairy cows. Animal Reproduction Science, 123(3–4), 127–138.

Yıldız, B. İ., & Karabağ, K. (2025). Prediction of beef production using LR, RF, kNN. KSU J. Agric Nat, 28(1), 247–255.

Zaborski, D., Ali, M., Eyduran, E., Grzesiak, W., Tariq, M. M., et al. (2019). Prediction of reproductive traits of Harnai sheep via ML. Pakistan Journal of Zoology, 51(2), 421–431.

Downloads

Published

27.06.2026

How to Cite

Çanga Boğa, D., & Boğa, M. (2026). Milk Yield Prediction Using Animal and Production Features: Optimal Combinations and Machine Learning Approaches. Turkish Journal of Agriculture - Food Science and Technology, 14(6), 1476–1482. https://doi.org/10.24925/turjaf.v14i6.1476-1482.8393

Issue

Section

Research Paper