Comparison of a Linear Mixed Model and Tree-Based Machine Learning Models for Daily Milk Yield Prediction in Dairy Cows During Summer

The expansion of digital technologies in dairy farming (precision dairy farming) has created new opportunities for the systematic use of data, which can lead to more efficient production processes. This study aimed to develop and evaluate models for predicting daily milk yield from dairy cows during summer. This yield was modeled at the individual level, with days in milk and parity group included as baseline covariates in all analyses. Three feature-set scenarios were defined and evaluated, in which the temperature–humidity index (THI) and milk yield history were added to the baseline variables either separately (Scenarios 1 and 2) or jointly (Scenario 3). Performance was evaluated using walk-forward validation, and feature selection was nested within each iteration’s training window. The performance of the linear mixed model (LMM) was then compared with two machine learning models, random forest (RF) and gradient boosting machine (GBM), within the same experimental framework. In Scenario 3, all three models showed similar fits (R2 = 0.92 and concordance correlation coefficient = 0.96), although the GBM model yielded a smaller error (root mean square error [RMSE] = 2.07 ± 0.22, mean absolute error [MAE] = 1.39 ± 0.12) than the RF model (RMSE = 2.10 ± 0.23, MAE = 1.45 ± 0.13) and the LMM (RMSE = 2.15 ± 0.22, MAE = 1.41 ± 0.10). Overall, adding the THI and recent milk yield history to the baseline variables improved short-term prediction accuracy in this dataset, with the GBM model showing the smallest error. These results can support farmers and herd managers in predicting short-term milk yield under heat stress conditions and making timely management decisions.

Authors

Institutions

Publication Details

Journal
Information
Published
2026-04-27
DOI
https://doi.org/10.3390/info17050415
Primary Topic
Effects of Environmental Stressors on Livestock
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Comparison of a Linear Mixed Model and Tree-Based Machine Learning Models for Daily Milk Yield Prediction in Dairy Cows During Summer

A.S. Atzori, Babak Darabighane
Information
Effects of Environmental Stressors on Livestock
article

Comparison of a Linear Mixed Model and Tree-Based Machine Learning Models for Daily Milk Yield Prediction in Dairy Cows During Summer

A.S. Atzori, Babak Darabighane
article en

Abstract

The expansion of digital technologies in dairy farming (precision dairy farming) has created new opportunities for the systematic use of data, which can lead to more efficient production processes. This study aimed to develop and evaluate models for predicting daily milk yield from dairy cows during summer. This yield was modeled at the individual level, with days in milk and parity group included as baseline covariates in all analyses. Three feature-set scenarios were defined and evaluated, in which the temperature–humidity index (THI) and milk yield history were added to the baseline variables either separately (Scenarios 1 and 2) or jointly (Scenario 3). Performance was evaluated using walk-forward validation, and feature selection was nested within each iteration’s training window. The performance of the linear mixed model (LMM) was then compared with two machine learning models, random forest (RF) and gradient boosting machine (GBM), within the same experimental framework. In Scenario 3, all three models showed similar fits (R2 = 0.92 and concordance correlation coefficient = 0.96), although the GBM model yielded a smaller error (root mean square error [RMSE] = 2.07 ± 0.22, mean absolute error [MAE] = 1.39 ± 0.12) than the RF model (RMSE = 2.10 ± 0.23, MAE = 1.45 ± 0.13) and the LMM (RMSE = 2.15 ± 0.22, MAE = 1.41 ± 0.10). Overall, adding the THI and recent milk yield history to the baseline variables improved short-term prediction accuracy in this dataset, with the GBM model showing the smallest error. These results can support farmers and herd managers in predicting short-term milk yield under heat stress conditions and making timely management decisions.

InformationVol. 17(5)
University of Sassari (IT), Istituto per il Sistema Produzione Animale in Ambiente Mediterraneo (IT)
Openalex Percentile: Top 10%
Effects of Environmental Stressors on Livestock
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.